public EnumerateClassesOpSettings(EnumerateLeafClassesOpSettings settings)
        {
            ReqType = RequestType.EnumerateClasses;

            ClassName = settings.ClassName;
            DeepInheritance = true;
            LocalOnly = settings.LocalOnly;
            IncludeQualifiers = settings.IncludeQualifiers;
            IncludeClassOrigin = settings.IncludeClassOrigin;
        }
예제 #2
0
        public CimClassList EnumerateLeafClasses(EnumerateLeafClassesOpSettings settings)
        {
            CimClassList allClasses = EnumerateClasses(new EnumerateClassesOpSettings(settings));
            CimClassList leafClasses = new CimClassList();
            Dictionary<CimName, bool> superClasses = new Dictionary<CimName, bool>();

            //changed for MONO
            //foreach (CimClass curClass in allClasses)
            for (int i = 0; i < allClasses.Count; ++i)
            {
                CimClass curClass = allClasses[i];
                if (curClass.SuperClass.IsSet)
                {
                    if (!superClasses.ContainsKey(curClass.SuperClass))
                    {
                        superClasses.Add(curClass.SuperClass, true);
                    }
                }
            }

            //foreach (CimClass curClass in allClasses)
            for (int i = 0; i < allClasses.Count; ++i)
            {
                CimClass curClass = allClasses[i];
                if (!superClasses.ContainsKey(curClass.ClassName))
                {
                    leafClasses.Add(curClass);
                }
            }

            return leafClasses;
        }