Table of Contents

Class ExtensionMethodsOnPathsCollection

Namespace
NDepend.Path
Assembly
NDepend.API.dll

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

seq IEnumerable<T>

The sequence to search in.

path K

The path to search for.

Returns

bool

Type Parameters

T
K

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

collection1 ICollection<T>

This collection of paths.

collection2 ICollection<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

T

The 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

collection ICollection<IAbsoluteDirectoryPath>

This collection of directories absolute paths.

commonRootDirectory IAbsoluteDirectoryPath

The 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.