Comments
1 comment
-
As far as I know the types are sort of readonly in Reflector - meaning you can't change values. However you could create your own cloner by using the objects in the CodeModel - but doing so will snowball on you mostlikely. Once you clone one object, you'll need to clone all of its children and members, etc.
Add comment
Please sign in to leave a comment.
This is example of code from my add-in:
// rename selected type after clicking button on my add-in window // AssemblyBrowser is property that sets to (IAssemblyBrowser)serviceProvider.GetService(typeof(IAssemblyBrowser)) on package loading private void buttonRename_Click(object sender, EventArgs e) { ITypeDeclaration typeDeclaration = AssemblyBrowser.ActiveItem as ITypeDeclaration; if (typeDeclaration != null) { typeDeclaration.Name = "MyName"; } }Exception throws in Reflector's method .set_Name(String value).Where is my mistake and how I can change type declaration?