Monday, 15 March 2010

c# - Expose Class properties to Visual Studio Properties window -



c# - Expose Class properties to Visual Studio Properties window -

i have visual studio extensions project vspackage extending microsoft.visualstudio.shell.package.

there class:

public class propertypageitem { private string _item1; private string _item2; public propertypageitem() { _item1 = "item1"; _item2 = "item2"; } [description("item1")] [category("item-field")] public string item1 { { homecoming _item1; } set { _item1 = value; } } [description("item2")] [category("item-field")] public string item2 { { homecoming _item2; } set { _item2 = value; } } }

the class above not dynamic (doesn't consider events etc), it's sake of understanding method.

how can link/expose class visual studio property window? it's same window can see file properties while browsing through solution explorer. objective utilize window , not create property grid control.

tried next instructions on link confused me further.

after little research figured out how it.

follow instructions in link

in step 6 of walkthrough, replace 'this' 'new propertypageitem()'

public override void ontoolwindowcreated() { arraylist listobjects = new arraylist(); listobjects.add(new propertypageitem()); selectlist(listobjects); }

following until step 7 on "exposing properties properties window" section, objective achieved , properties in propertypageitem class exposed onto visual studio propertywindow.

hope helpful.

c# visual-studio visual-studio-extensions visual-studio-sdk

No comments:

Post a Comment