示例#1
0
        public static List <ValuedProperty> FindItemProperty(Item item, bool visible = false)
        {
            List <Type> ll = System.Reflection.Assembly.GetExecutingAssembly().GetTypes()
                             .ToList().Where(r => r.FullName.Contains("MannequinProperty") && r.IsClass == true && r.IsAbstract == false).ToList();

            List <ValuedProperty> cat = new List <ValuedProperty>();

            ll.ForEach(x =>
            {
                object CI = Activator.CreateInstance(Type.GetType(x.FullName));

                if (CI is ValuedProperty)
                {
                    ValuedProperty p = CI as ValuedProperty;

                    if (p.Matches(item) || visible && p.AlwaysVisible)
                    {
                        cat.Add(p);
                    }
                }
            });

            return(cat.OrderByDescending(x => x.Hue).ToList());
        }
示例#2
0
        public static List <ValuedProperty> FindItemsProperty(List <Item> item)
        {
            var ll = System.Reflection.Assembly.GetExecutingAssembly().GetTypes()
                     .ToList().Where(r => r.FullName.Contains("MannequinProperty") && r.IsClass == true && r.IsAbstract == false).ToList();

            List <ValuedProperty> cat = new List <ValuedProperty>();

            ll.ForEach(x =>
            {
                var CI = Activator.CreateInstance(Type.GetType(x.FullName));

                if (CI is ValuedProperty)
                {
                    ValuedProperty p = CI as ValuedProperty;

                    if (p.Matches(item) || p.AlwaysVisible)
                    {
                        cat.Add(p);
                    }
                }
            });

            return(cat);
        }