Saturday, June 23, 2012 6:54 PM
I write a Add-in for visual studio 2010.
I want to copy the code in a variable like:
string code = _applicationObject.ActiveWindow.xxx();
//instead of xxx() i want the written code.
code = MyFormatCodeFunction(code);
// instead of yyy() i want to set the formatted code
Sunday, June 24, 2012 5:15 PMNo ideas?
Sunday, June 24, 2012 6:25 PMModerator
It isn't clear what you are asking for. What do you mean 'copy code in a variable'? In the example you show there is no variable, there is a method invocation on the ActiveWindow object. You would need to be more explicit in what you are trying to do in order for someone to offer advice.
Tuesday, June 26, 2012 1:49 AMModerator
I think you are looking for the code model which you can access the code in the editor (document). You can get the exact code of a method there and write back after modifing.
Get started from Discovering Code by Using the Code Model (Visual C#)
- Marked As Answer by Ego JiangMicrosoft Contingent Staff, Moderator Tuesday, July 03, 2012 7:40 AM
Tuesday, July 03, 2012 7:40 AMModerator
I will mask Yi's reply as the answer.
If it is not the answer you want. Please unmark it.
MSDN Community Support | Feedback to us