Пример #1
0
        public override AttributeCollection GetAttributes()
        {
            var attrs = GameTypeDescriptionProvider.GetOriginalProvider <IRecord>()
                        .GetTypeDescriptor(_type).GetAttributes().Cast <Attribute>().ToList();

            attrs.Add(new TypeConverterAttribute(typeof(RecordConverter)));
            attrs.Add(new EditorAttribute(typeof(RecordEditor), typeof(UITypeEditor)));
            return(new AttributeCollection(attrs.ToArray()));
        }
Пример #2
0
        public override AttributeCollection GetAttributes()
        {
            var attrs = GameTypeDescriptionProvider.GetOriginalProvider <Enum>()
                        .GetTypeDescriptor(_type).GetAttributes().Cast <Attribute>().ToList();

            attrs.Add(new TypeConverterAttribute(typeof(EnumConverter)));
            if (attrs.Any(attr => attr is FlagsAttribute))
            {
                attrs.Add(new EditorAttribute(typeof(FlagsEditor), typeof(UITypeEditor)));
            }
            return(new AttributeCollection(attrs.ToArray()));
        }