summaryrefslogtreecommitdiff
path: root/product/Presentation/Model/FileSystem/folder.cs
blob: 9aa8c0eb77645ba3b18fcab7c5d3ccc4c06f3266 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
namespace MoMoney.Presentation.Model.FileSystem
{
    public interface IFolder
    {
        string path { get; }
    }

    internal class folder : IFolder
    {
        public folder(string path)
        {
            this.path = path;
        }

        public string path { get; private set; }

        public override string ToString()
        {
            return path;
        }

        public bool Equals(folder obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            return ReferenceEquals(this, obj) || Equals(obj.path, path);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            return obj.GetType() == typeof (folder) && Equals((folder) obj);
        }

        public override int GetHashCode()
        {
            return (path != null ? path.GetHashCode() : 0);
        }
    }
}