WeaverUtilities.

TopologicalSort<T>(IEnumerable<T>, bool) Method

Summary

Sorts a collection of Weaver.IDependant`1. If ItemA depends on ItemB, ItemA will be put later in the returned list.
Assembly
Weaver.dll
Namespace
Weaver
Containing Type
WeaverUtilities

Syntax

public static List<T> TopologicalSort<T>(IEnumerable<T> collection, bool ignoreCycles = false) 
    where T : IDependant<T>

Type Parameters

Name Description
T

Parameters

Name Type Description
collection IEnumerable<T> The collection to sort. If any item depends on a type that isn't present, it will be added automatically.
ignoreCycles bool If false, an System.ArgumentException will be thrown when a cyclic dependancy is encountered.

Return Value

Type Description
List<T>