Class ExtensionMethodsOnPathsCollection
Extension methods helpers on collection of paths.
public static class ExtensionMethodsOnPathsCollection
- Inheritance
-
ExtensionMethodsOnPathsCollection
- Inherited Members
Methods (3)
ContainsPath<T, K>(IEnumerable<T>, K)
Returns true if seq contains path.
public static bool ContainsPath<T, K>(this IEnumerable<T> seq, K path) where T : class, IPath where K : class, IPath
Parameters
seqIEnumerable<T>The sequence to search in.
pathKThe path to search for.
Returns
Type Parameters
TK
Remarks
The method IPath.Equals(), overridden from System.Object, is used to test path equality.
ContainsSamePathsThan<T>(ICollection<T>, ICollection<T>)
Determine if this collection1 and collection2 contain the same set of paths.
public static bool ContainsSamePathsThan<T>(this ICollection<T> collection1, ICollection<T> collection2) where T : class, IPath
Parameters
collection1ICollection<T>This collection of paths.
collection2ICollection<T>The other collection of paths.
Returns
- bool
true if collection2 contains the same set of path than this collection1. true also, if this collection1 and collection2 are both null. true also, if this collection1 and collection2 are both empty.
Type Parameters
TThe path type, any interface type implementing IPath
Remarks
Collections can contain null paths.
TryGetCommonRootDirectory(ICollection<IAbsoluteDirectoryPath>, out IAbsoluteDirectoryPath)
Find the common root directory of all directories of this collection.
public static bool TryGetCommonRootDirectory(this ICollection<IAbsoluteDirectoryPath> collection, out IAbsoluteDirectoryPath commonRootDirectory)
Parameters
collectionICollection<IAbsoluteDirectoryPath>This collection of directories absolute paths.
commonRootDirectoryIAbsoluteDirectoryPathThe common root directory if it has been found.
Returns
- bool
true if a common root directory has been found, else returns false.
Remarks
A return value indicates whether a common root directory has been found. A common root directory cannot be found if at least two directories path on two different drives are in this collection. If the collection contains at least one null path, a common root directory cannot be found.