Exemple #1
0
        public override IDictionary <string, IAnalysisSet> GetAllMembers(IModuleContext moduleContext, GetMemberOptions options = GetMemberOptions.None)
        {
            var res = new Dictionary <string, IAnalysisSet>();

            if (_instanceAttrs != null)
            {
                foreach (var kvp in _instanceAttrs)
                {
                    var types = kvp.Value.TypesNoCopy;
                    var key   = kvp.Key;
                    kvp.Value.ClearOldValues();
                    if (kvp.Value.VariableStillExists)
                    {
                        MergeTypes(res, key, types);
                    }
                }
            }

            // check and see if it's defined in a base class instance as well...
            if (!options.HasFlag(GetMemberOptions.DeclaredOnly))
            {
                foreach (var b in _classInfo.Bases)
                {
                    foreach (var ns in b)
                    {
                        if (ns.Push())
                        {
                            try {
                                ClassInfo baseClass = ns as ClassInfo;
                                if (baseClass != null &&
                                    baseClass.Instance._instanceAttrs != null)
                                {
                                    foreach (var kvp in baseClass.Instance._instanceAttrs)
                                    {
                                        kvp.Value.ClearOldValues();
                                        if (kvp.Value.VariableStillExists)
                                        {
                                            MergeTypes(res, kvp.Key, kvp.Value.TypesNoCopy);
                                        }
                                    }
                                }
                            } finally {
                                ns.Pop();
                            }
                        }
                    }
                }

                foreach (var classMem in _classInfo.GetAllMembers(moduleContext))
                {
                    MergeTypes(res, classMem.Key, classMem.Value);
                }
            }
            return(res);
        }
Exemple #2
0
        public override IDictionary <string, ISet <Namespace> > GetAllMembers(IModuleContext moduleContext)
        {
            var res = new Dictionary <string, ISet <Namespace> >();

            if (_instanceAttrs != null)
            {
                foreach (var kvp in _instanceAttrs)
                {
                    var types = kvp.Value.Types;
                    var key   = kvp.Key;

                    MergeTypes(res, key, types);
                }
            }

            foreach (var classMem in _classInfo.GetAllMembers(moduleContext))
            {
                MergeTypes(res, classMem.Key, classMem.Value);
            }
            return(res);
        }