Пример #1
0
        public override void Init()
        {
            ClassEnumerator enumerator = new ClassEnumerator(typeof(SkillBaseSelectTargetAttribute), typeof(SkillBaseSelectTarget), typeof(SkillBaseSelectTargetAttribute).Assembly, true, false, false);

            foreach (System.Type type in enumerator.results)
            {
                SkillBaseSelectTarget target          = (SkillBaseSelectTarget)Activator.CreateInstance(type);
                Attribute             customAttribute = Attribute.GetCustomAttribute(type, typeof(SkillBaseSelectTargetAttribute));
                this.registedRule.Add((uint)(customAttribute as SkillBaseSelectTargetAttribute).TargetRule, target);
            }
        }
Пример #2
0
        public override void Init()
        {
            ClassEnumerator classEnumerator = new ClassEnumerator(typeof(SkillBaseSelectTargetAttribute), typeof(SkillBaseSelectTarget), typeof(SkillBaseSelectTargetAttribute).get_Assembly(), true, false, false);

            foreach (Type current in classEnumerator.results)
            {
                SkillBaseSelectTarget value           = (SkillBaseSelectTarget)Activator.CreateInstance(current);
                Attribute             customAttribute = Attribute.GetCustomAttribute(current, typeof(SkillBaseSelectTargetAttribute));
                this.registedRule.Add((uint)(customAttribute as SkillBaseSelectTargetAttribute).TargetRule, value);
            }
        }
Пример #3
0
        public override void Init()
        {
            ClassEnumerator classEnumerator = new ClassEnumerator(typeof(SkillBaseSelectTargetAttribute), typeof(SkillBaseSelectTarget), typeof(SkillBaseSelectTargetAttribute).get_Assembly(), true, false, false);

            using (ListView <Type> .Enumerator enumerator = classEnumerator.get_results().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Type current = enumerator.get_Current();
                    SkillBaseSelectTarget skillBaseSelectTarget = (SkillBaseSelectTarget)Activator.CreateInstance(current);
                    Attribute             customAttribute       = Attribute.GetCustomAttribute(current, typeof(SkillBaseSelectTargetAttribute));
                    this.registedRule.Add((customAttribute as SkillBaseSelectTargetAttribute).TargetRule, skillBaseSelectTarget);
                }
            }
        }