Exemplo n.º 1
0
 /// <summary>
 /// Determines if the given object is at or under the given directory
 /// </summary>
 /// <param name="Other">Directory to check against</param>
 /// <returns>True if this path is under the given directory</returns>
 public bool IsUnderDirectory(DirectoryReference Other)
 {
     return(FullName.StartsWith(Other.FullName, Comparison) && (FullName.Length == Other.FullName.Length || FullName[Other.FullName.Length] == Path.DirectorySeparatorChar || Other.IsRootDirectory()));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Determines if the given object is at or under the given directory
 /// </summary>
 /// <param name="Other">Directory to check against</param>
 /// <returns>True if this path is under the given directory</returns>
 public bool IsUnderDirectory(DirectoryReference Other)
 {
     return(CanonicalName.StartsWith(Other.CanonicalName) && (CanonicalName.Length == Other.CanonicalName.Length || CanonicalName[Other.CanonicalName.Length] == Path.DirectorySeparatorChar || Other.IsRootDirectory()));
 }