internal void PromoteToRoot(DependencyMethod method)
 {
     if (_remainingNonRoots.Remove(method))
     {
         _remainingRoots.Add(method);
     }
 }
 public void RemoveFromCalledBy(DependencyMethod calledMethod)
 {
     CalledBy.Remove(calledMethod);
     if (!HasCallers)
     {
         Graph.PromoteToRoot(this);
     }
 }
        public bool Contains(DependencyMethod method)
        {
            if (_remainingRoots.Contains(method))
            {
                return(true);
            }

            return(_remainingNonRoots.Contains(method));
        }
Esempio n. 4
0
 internal void AddToResult(DependencyMethod method)
 {
     _result.Methods.Add(new MethodCompilationListItem
     {
         FullTypeName = method.FullTypename,
         MethodName   = method.MethodName,
         Signature    = method.Signature
     }
                         );
 }
 internal void Remove(DependencyMethod method)
 {
     if (method.IsRoot)
     {
         _remainingRoots.Remove(method);
     }
     else
     {
         _remainingNonRoots.Remove(method);
     }
 }
Esempio n. 6
0
        private void AddToResultList(DependencyMethod method)
        {
            if (!_callGraph.Contains(method))
            {
                return; // has already been added to result / removed from graph
            }
            AddToResult(method);
            method.RemoveFromGraph();

            // depth first search if callers remain (if not -> recursive remove + search)
            foreach (var child in method.Calls)
            {
                if (child.IsRoot)
                {
                    AddToResultList(child);
                }
            }
        }
 public void RemoveFromCalls(DependencyMethod calledMethod)
 {
     Calls.Remove(calledMethod);
 }