visual-studio-macros

Visual Studio macro to navigate to T4MVC link

只谈情不闲聊 提交于 2019-12-06 00:31:41
I use T4MVC and I'm happy with it and want to keep it - it keeps down run time defects. Unfortunately, it makes it harder to navigate to views and content (a.k.a. Views and Links in T4MVC) though. Even using Resharper, I can't navigate to the referenced item: T4MVC and Resharper Navigation Can I get a hand building a macro to do this? Never having built a VS IDE macro before, I don't have a grasp on how to get at some things, like the internal results of the "Go To Definition" process, if that's even possible. If you aren't familiar with T4MVC, here's generally what the macro might do to help:

How can I perform “Go To Definition” programmatically in Visual Studio?

非 Y 不嫁゛ 提交于 2019-12-06 00:26:46
问题 Given a string that represents a specific class/field/property (eg MyNameSpace.MyClass or System.String.Length ), how can I programmatically cause Visual Studio to go to that class/field/property (ie, make Visual Studio do the same thing that would happen if I was to type in the reference in the code editor and then hit F12)? 回答1: You probably need to do the following. Get the global IVsObjectManager2 interface (implemented by the SVsObjectManager object) Call IVsObjectManager2.FindLibrary to

Automatically Add Regions to Code in Visual Studio

社会主义新天地 提交于 2019-12-05 20:25:55
问题 My team absolutely loves using regions, and with that in mind it's pretty much become a de-facto standard in our code. I recently came to realization that I'm sick of writing or ctrl+c / ctrl+v'ing these in every time I create a class, test method, etc... I was wondering if it is possible (via macros or some other functionality) to have Visual Studio automatically add these into your code. For example, If I add a new class file to my project, can you perform some sort of magic to have visual

Is there an API Style reference for Visual Studio Macros

故事扮演 提交于 2019-12-05 19:20:37
I would like to automate some common tasks that I do using Visual Studio Macros but I can't find a decent API reference for visual studio objects accessible through macros. Does such a think exist? Or is there a way I can find out what I need with the API? Do you mean the DTE ? Extending the Visual Studio Environment Customizing, Automating, and Extending the Development Environment How to: Use Add-ins to Control Macros 来源: https://stackoverflow.com/questions/4719371/is-there-an-api-style-reference-for-visual-studio-macros

Accessing Visual Studio macros from source code?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 14:36:22
问题 Visual Studio has macros like $(TargetDirectory) , $(OutputPath) etc. In my source code, I want to specify a relative path for the loading of a file from a folder a few levels below the TargetDirectory . Currently I'm doing this: mLayer = mEngine->AddLayer("D:\\Projects\\abc.osg"); and I want it to be something like mLayer = mEngine->AddLayer(($TargetDirectory)+"..\\..\\abc.osg"); It's just a temporary requirement, so that I can give my code to a person for a small demo, and his

How Can I Create a Visual Studio Macro to Change the Keyboard Layout?

本小妞迷上赌 提交于 2019-12-04 20:39:55
Is it possible to create a Visual Studio (2010) macro to change the keyboard layout? I find the "copy and paste from other applications" bug in Emacs Emulation Mode a bit annoying, so what I wanted to do is create two simple macros - one to set keyboard layout to the Emacs keyboard layout, and one to switch the layout to default (I'm sure there would be an easy way to combine them into "switch between the two", but I wanted to start simple). Not knowing much about VS macros, I figured I could just employ the "hit record and click around" development methodology. Unfortunately, hitting record

Excel & VBA: Copy rows into a new sheet based on cell value

喜欢而已 提交于 2019-12-04 07:13:27
问题 I'm a total newbie in Excel and VBA. I have a sheet like this: A B C D someinfo someinfo someinfo OK someinfo someinfo someinfo OK someinfo someinfo someinfo ERROR someinfo someinfo someinfo ERROR someinfo someinfo someinfo OK someinfo someinfo someinfo OK someinfo someinfo someinfo ERROR someinfo someinfo someinfo ERROR Ok I'd like to copy the "OK" lines into a new sheet and the one with "ERROR" into another one. How can I do that? 回答1: As stated in earlier comments this is how you would

Automatically Add Regions to Code in Visual Studio

青春壹個敷衍的年華 提交于 2019-12-04 02:56:07
My team absolutely loves using regions, and with that in mind it's pretty much become a de-facto standard in our code. I recently came to realization that I'm sick of writing or ctrl+c / ctrl+v'ing these in every time I create a class, test method, etc... I was wondering if it is possible (via macros or some other functionality) to have Visual Studio automatically add these into your code. For example, If I add a new class file to my project, can you perform some sort of magic to have visual studio generate the file as: namespace Test { class MyClass { #region ------------ members ------------

Debug custom dll that is being referenced in visual studio macro

我是研究僧i 提交于 2019-12-03 17:41:48
问题 I previously asked: Add dll reference to visual studio macros the idea of creating the macros in my language (C#) makes it easier to create the macros. The problem is that I cannot debug the dll To solve the problem I have tried: I placed myClassLibrary.pdb next to myClassLibrary.dll hoping I where going to be able to debug the methods in the dll by steping in to them. Created a WCF service. Because I did not knew how to reference the service from vba I reference it from the class library.

Debug custom dll that is being referenced in visual studio macro

試著忘記壹切 提交于 2019-12-03 07:27:11
I previously asked: Add dll reference to visual studio macros the idea of creating the macros in my language (C#) makes it easier to create the macros. The problem is that I cannot debug the dll To solve the problem I have tried: I placed myClassLibrary.pdb next to myClassLibrary.dll hoping I where going to be able to debug the methods in the dll by steping in to them. Created a WCF service. Because I did not knew how to reference the service from vba I reference it from the class library. The problem is that I need to use variables such as DTE.ActiveDocument and those variables are not