src/Misc/EFTools/XmlCore/Model/DependencyGraph.cs
/// <summary>
///     Add a new dependency from item->dependency.
/// </summary>
/// <param name="item"></param>
/// <param name="dependency"></param>
Add a new dependency from item->dependency.
Add a new dependency from item - > dependency .
internal void AddDependency(T item, T dependency)
        {
            if (item != null
                && item.Equals(dependency))
            {
                Debug.Assert(true, "Attempted to add a cyclic dependency to graph");
                return;
            }
#if TRACK_DEPENDENCIES
            List<T> deps = null;
            if (!_dependencyMap.TryGetValue(item, out deps))
            {
                deps = new List<T>();
                _dependencyMap.Add(item, deps);
            }
                deps.Add(dependency);
#endif
            List<T> antiDeps = null;
            if (!_antiDependencyMap.TryGetValue(dependency, out antiDeps))
            {
                antiDeps = new List<T>();
                _antiDependencyMap.Add(dependency, antiDeps);
            }
            antiDeps.Add(item);
        }
internal void AddDependency ( T item , T dependency ) { if ( item != null && item . Equals ( dependency ) ) { Debug . Assert ( true , " " ) ; return ; } if TRACK_DEPENDENCIES List < T > deps = null ; if ( ! _dependencyMap . TryGetValue ( item , out deps ) ) { deps = new List < T > ( ) ; _dependencyMap . Add ( item , deps ) ; } deps . Add ( dependency ) ; endif List < T > antiDeps = null ; if ( ! _antiDependencyMap . TryGetValue ( dependency , out antiDeps ) ) { antiDeps = new List < T > ( ) ; _antiDependencyMap . Add ( dependency , antiDeps ) ; } antiDeps . Add ( item ) ; }
Add a new dependency from item->dependency.
Add a new dependency from item - > dependency .
item
T
None
dependency
T
None