How to deal with a sealed class when I wanted to inherit and add properties

前端 未结 6 1404
慢半拍i
慢半拍i 2020-12-15 15:15

In a recent question on Stack Overflow, I asked how I might parse through a file name to extra meta info about a file.

After I worked through that problem, I decided

6条回答
  •  旧巷少年郎
    2020-12-15 16:05

    Pass-thru?

    class BackupFileInfo : IEquatable
    {
        public long Length {get {return FileInfo.Length;}}
        //.... [snip]
    }
    

    Also, a prop called FileInfo is asking for trouble... it may need disambiguation against the FileInfo class in a few places.

提交回复
热议问题