Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

MPF project property TypeConverter

$
0
0

Hi,

I made a project type using mpf, my project properties windows inherit from Microsoft.VisualStudio.Project.SettingsPage and works fine but I need to display an enum with a TypeConverter associated to it. Here is what I did but it doesn't work.

    public enum MyEnum
    {
        [EnumMemberName("enum field 1")]
        FIELD_1,
        [EnumMemberName("enum field 2")]
        FIELD_2
    };

        [DisplayName("prop1")]
        [Category("Enum Options")]
        [Description("My enum option")]
        [TypeConverter(typeof(MyEnumConverter<MyEnum>))]
        public MyEnum prop1
        {
            get { return this.prop1_; }
            set { this.prop1_ = value; this.IsDirty = true; }
        }

MyEnumConverter works correctly with standard PropertyGrid control but here it doesn't. Actually it is not even called and created.

I tried Microsoft.VisualStudio.Shell.PropertyPageTypeConverterAttribute too, but it doesn't works either.

I saw Microsoft.VisualStudio.Project.SettingsPage use  IVSMDPropertyGrid instead of PropertyGrid control, is it the reason of my issue? How can I solve it?

Thanks


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>