示例#1
0
            public bool OnSameVolumeThan(IAbsolutePath otherAbsolutePath)
            {
                Argument.IsNotNull(nameof(otherAbsolutePath), otherAbsolutePath);

                if (Type != otherAbsolutePath.Type)
                {
                    return(false);
                }

                if (Type == AbsolutePathType.DriveLetter)
                {
                    return(DriveLetter.Equals(otherAbsolutePath.DriveLetter));
                }

                return(string.Compare(UNCServer, otherAbsolutePath.UNCServer, StringComparison.OrdinalIgnoreCase) == 0 &&
                       string.Compare(UNCShare, otherAbsolutePath.UNCShare, StringComparison.OrdinalIgnoreCase) == 0);
            }
            public bool OnSameVolumeThan(IAbsolutePath otherAbsolutePath)
            {
                Debug.Assert(otherAbsolutePath != null);                 // Enforced by contract
                if (Kind != otherAbsolutePath.Kind)
                {
                    return(false);
                }
                switch (Kind)
                {
                case AbsolutePathKind.DriveLetter:
                    return(DriveLetter.Equals(otherAbsolutePath.DriveLetter));

                default:
                    Debug.Assert(Kind == AbsolutePathKind.UNC);

                    // Compare UNC server and share, with ignorcase.
                    return(String.Compare(UNCServer, otherAbsolutePath.UNCServer, true) == 0 &&
                           String.Compare(UNCShare, otherAbsolutePath.UNCShare, true) == 0);
                }
            }