示例#1
0
        public static List <Type> CreateDefaultTypesList(Type clazz)
        {
            List <Type> defaultClassList = new List <Type>();
            var         mainClasses      = FindDerivedTypes(clazz);

            foreach (var currentSubclass in mainClasses)
            {
                var subClasses = FindDerivedTypes(currentSubclass);

                if (subClasses.Count() > 0)
                {
                    foreach (var currentClass in subClasses)
                    {
                        defaultClassList.Add(currentClass);
                    }
                }
                else
                {
                    if (AdvancedManager.IsAbstract(currentSubclass) == false)
                    {
                        defaultClassList.Add(currentSubclass);
                    }
                }
            }

            return(defaultClassList);
        }
示例#2
0
        public static List <Type> CreateAdvancedEvaluatorTypesList(Type evaluatorClass, ICoreConfig config)
        {
            List <Type> evaluatorAdvancedEvalClassList = new List <Type>();

            IEnumerable <Type> lstEvaluatorClass = FindDerivedTypes(evaluatorClass);

            foreach (Type evaluatorSubclass in lstEvaluatorClass)
            {
                IEnumerable <Type> lstEvaluatorSubclass = FindDerivedTypes(evaluatorSubclass);
                foreach (Type evalClass in lstEvaluatorSubclass)
                {
                    foreach (Type evalClassType in AdvancedManager.GetClasses(config, evalClass))
                    {
                        evaluatorAdvancedEvalClassList.Add(evalClassType);
                    }
                }
            }

            if (AdvancedManager.CheckDuplicate(evaluatorAdvancedEvalClassList) == false)
            {
                var logger = Application.Resolve <ILoggingService>();
                logger.Warning("Дубликат имени evaluator");
            }

            return(evaluatorAdvancedEvalClassList);
        }
示例#3
0
        private static List <Type> GetClasses(ICoreConfig config, Type classType, bool getAllClasses = false)
        {
            List <Type> classes = new List <Type>();

            if (AdvancedManager.GetAdvancedClassesList(config).ContainsKey(classType.Name) == true)
            {
                //classes = copy(AdvancedManager._get_advanced_classes_list(config)[class_type.get_name()])
                Debug.WriteLine(1);
            }

            if (classes.Count == 0 || (getAllClasses == true && classes.Contains(classType) == false))
            {
                classes.Add(classType);
            }

            return(classes);
        }