예제 #1
0
        public IEnumerable <KeyValuePair <Dependency, Hash> > GetDependencies(AttributedTypesCache cache)
        {
            var ret = new List <KeyValuePair <Dependency, Hash> >();

            GetDependencies(ret, 0, cache);
            return(ret);
        }
예제 #2
0
 public IEnumerable <KeyValuePair <Dependency, Hash> > GetDependencies(AttributedTypesCache cache)
 {
     foreach (var pair in Roots)
     {
         foreach (var dependency in pair.Value.GetDependencies(cache))
         {
             yield return(dependency);
         }
     }
 }
예제 #3
0
        private void GetDependencies(List <KeyValuePair <Dependency, Hash> > ret, uint dependency, AttributedTypesCache cache)
        {
            var hash = 0;

            if (myAnnotations != null)
            {
                foreach (var annotation in myAnnotations)
                {
                    var cls = cache.FindDeclaration(annotation);
                    Assertion.Assert(cls != null, "cls != null");
                    var hashableDeclaration = cls as IHashableDeclaration;
                    Assertion.Assert(hashableDeclaration != null, "hashableDeclaration != null");
                    var calcHash = hashableDeclaration.CalcHash();
                    foreach (var declaration in cls.MemberDeclarations)
                    {
                        var memberDeclaration = declaration as IHashableDeclaration;
                        if (memberDeclaration != null)
                        {
                            calcHash += memberDeclaration.CalcHash();
                        }
                    }
                    hash += calcHash.GetHashCode();
                }

                if (hash != 0)
                {
                    ret.Add(KeyValuePair.Of(new Dependency(dependency), new Hash(hash)));
                }
            }
            if (myChildren != null)
            {
                foreach (var child in myChildren)
                {
                    child.Value.GetDependencies(ret, dependency + (uint)child.Key.GetHashCode(), cache);
                }
            }
        }