projectitem

Adding controls to a form when I only have the reference to it’s EnvDTE

為{幸葍}努か 提交于 2020-01-06 12:50:30
问题 I am writing na Add-In for Visual Studio 2010, and I want it to add controls to an existing Form in an existing Project in an existing Solution, and I already have references to all of them. As I have the reference to the Project Item that represents the file of the form, I want a reference to the Form per se, then I’ll be able to do anything to it (changing properties, and adding controls). I have tried some approaches, though I must admit I haven’t ran out of tries. But since this is quite

Adding controls to a form when I only have the reference to it’s EnvDTE

亡梦爱人 提交于 2020-01-06 12:50:09
问题 I am writing na Add-In for Visual Studio 2010, and I want it to add controls to an existing Form in an existing Project in an existing Solution, and I already have references to all of them. As I have the reference to the Project Item that represents the file of the form, I want a reference to the Form per se, then I’ll be able to do anything to it (changing properties, and adding controls). I have tried some approaches, though I must admit I haven’t ran out of tries. But since this is quite

Finding a ProjectItem by type name via DTE

廉价感情. 提交于 2019-12-29 04:46:06
问题 Given a type name, is it possible to use DTE to find the ProjectItem that the type is located in? Something similar to how the Navigate To... dialog works in Visual Studio 2010. The closest I could find is Solution.FindProjectItem, but that takes in a file name. Thanks! 回答1: I've been trying to do something similar, and have come up with the following, which simply searches through namespaces and classes until it hits the one you're looking for. It seems to work in most cases although when

Finding a ProjectItem by type name via DTE

烈酒焚心 提交于 2019-12-29 04:46:05
问题 Given a type name, is it possible to use DTE to find the ProjectItem that the type is located in? Something similar to how the Navigate To... dialog works in Visual Studio 2010. The closest I could find is Solution.FindProjectItem, but that takes in a file name. Thanks! 回答1: I've been trying to do something similar, and have come up with the following, which simply searches through namespaces and classes until it hits the one you're looking for. It seems to work in most cases although when