
I am in need of parsing InitializeComponent. In C#, aswell as in VB.Net, this method is in most cases placed in a [filename].designer.[extension] file. However, this might not be the case, as it can be placed within the [filename].[extension] file aswell! Because of this I need SE to parse both files (I can give them both files, that's no problem) and then resolve the type and get the InitializeComponent AST. I've tried two ways:
1. Do a Document.LoadFile([filename].[extension]), and assign the code of the [filename].designer.[extension] to the footertext property of this document. However, do note that there are two classes (with one being partial). I didn't think I could get the needed AST from Document related functions. I've tried using dotNetProjectResolver.SourceProjectContent, but it didn't work out: it does add a sourcekey, but no types are returned for the sourcekey (using GetTypesForSourceKey). Would you recommend me using the ProjectResolver or would you use the Document to get the needed AST?
2. Do a Document.LoadFile([filename].[extension]), and add the code of the [filename].designer.[extension] to the ProjectResolve using LoadCode() or LoadFile(). The same problem exists here: no types are returned for the sourcekey.
Regards,
Michel van den Berg
Microsoft Student Partner, The Netherlands
Website: http://www.promontis.nl
1. Do a Document.LoadFile([filename].[extension]), and assign the code of the [filename].designer.[extension] to the footertext property of this document. However, do note that there are two classes (with one being partial). I didn't think I could get the needed AST from Document related functions. I've tried using dotNetProjectResolver.SourceProjectContent, but it didn't work out: it does add a sourcekey, but no types are returned for the sourcekey (using GetTypesForSourceKey). Would you recommend me using the ProjectResolver or would you use the Document to get the needed AST?
2. Do a Document.LoadFile([filename].[extension]), and add the code of the [filename].designer.[extension] to the ProjectResolve using LoadCode() or LoadFile(). The same problem exists here: no types are returned for the sourcekey.
Regards,
Michel van den Berg
Microsoft Student Partner, The Netherlands
Website: http://www.promontis.nl