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 RemoveDependency(T item, T dependency)
        {
#if TRACK_DEPENDENCIES
            List<T> deps = null;
            _dependencyMap.TryGetValue(item, out deps);
            if (deps == null || !deps.Contains(dependency))
            {
                Debug.Assert(false, "item does not have specified dependency");
            }
            else
            {
                deps.Remove(dependency);
            }
            if (deps.Count == 0)
            {
                _dependencyMap.Remove(item);
            }
#endif
            List<T> antiDeps = null;
            _antiDependencyMap.TryGetValue(dependency, out antiDeps);
            if (antiDeps == null
                || !antiDeps.Contains(item))
            {
                Debug.Assert(false, "dependency does not have specified anti-depencency");
            }
            else
            {
                antiDeps.Remove(item);
            }
            if (antiDeps.Count == 0)
            {
                _antiDependencyMap.Remove(dependency);
            }
        }
internal void RemoveDependency ( T item , T dependency ) { if TRACK_DEPENDENCIES List < T > deps = null ; _dependencyMap . TryGetValue ( item , out deps ) ; if ( deps == null || ! deps . Contains ( dependency ) ) { Debug . Assert ( false , " " ) ; } else { deps . Remove ( dependency ) ; } if ( deps . Count == 0 ) { _dependencyMap . Remove ( item ) ; } endif List < T > antiDeps = null ; _antiDependencyMap . TryGetValue ( dependency , out antiDeps ) ; if ( antiDeps == null || ! antiDeps . Contains ( item ) ) { Debug . Assert ( false , " " ) ; } else { antiDeps . Remove ( item ) ; } if ( antiDeps . Count == 0 ) { _antiDependencyMap . Remove ( dependency ) ; } }
Add a new dependency from item->dependency.
Add a new dependency from item - > dependency .
// remove this from the map if we have no more deps // remove this from the map if we have no more anti-deps
item
T
None
dependency
T
None