SharpCifs.Smb.SmbFile.Equals C# (CSharp) Method

Equals() public method

Tests to see if two SmbFile objects are equal.
Tests to see if two SmbFile objects are equal. Two SmbFile objects are equal when they reference the same SMB resource. More specifically, two SmbFile objects are equals if their server IP addresses are equal and the canonicalized representation of their URLs, minus authentication parameters, are case insensitivly and lexographically equal.

For example, assuming the server angus resolves to the 192.168.1.15 IP address, the below URLs would result in SmbFiles that are equal.

 smb://192.168.1.15/share/DIR/foo.txt smb://angus/share/data/../dir/foo.txt 
SmbException
public Equals ( object obj ) : bool
obj object Another SmbFile object to compare for equality
return bool
        public override bool Equals(object obj)
        {
            if (obj is SmbFile)
            {
                SmbFile f = (SmbFile)obj;
                bool ret;
                if (this == f)
                {
                    return true;
                }
                if (PathNamesPossiblyEqual(Url.AbsolutePath, f.Url.AbsolutePath))
                {
                    GetUncPath0();
                    f.GetUncPath0();
                    if (Runtime.EqualsIgnoreCase(_canon, f._canon))
                    {
                        try
                        {
                            ret = GetAddress().Equals(f.GetAddress());
                        }
                        catch (UnknownHostException)
                        {
                            ret = Runtime.EqualsIgnoreCase(GetServer(), f.GetServer());
                        }
                        return ret;
                    }
                }
            }
            return false;
        }