Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could write a Visual Studio 2012 extension to accomplish this!<br> If you've never written an Add-in before, this is a simple one to get you started!</p> <p>Here are the steps to create this type of add-in:</p> <ol> <li>Create a <strong>New Project</strong> in Visual Studio 2012</li> <li>Choose <strong>Templates</strong> -> <strong>Other Project Types</strong> -> <strong>Extensibility</strong> -> Visual Studio Add-in</li> <li>Name your project, click OK.</li> <li>Follow the Add-in wizard steps. When prompted, check the box for: "Yes, create a 'Tools' menu item." Optionally, I also check "My Add-in will never put up modal UI..."</li> <li><p>Finish the wizard and implement the follow code in <strong>Exec(...)</strong></p> <pre><code>public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled) { handled = false; if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault) { if (commandName == this.GetType().Namespace + ".Connect." + this.GetType().Namespace) { if (_applicationObject.ActiveDocument != null) { TextSelection objSel = (EnvDTE.TextSelection)(_applicationObject.ActiveDocument.Selection); objSel.Insert(Guid.NewGuid().ToString()); } handled = true; return; } } } </code></pre></li> <li><p>Build the project, and deploy <strong>AddInName.dll</strong>, <strong>AddInName.AddIn</strong>, and <strong>AddInName.xml</strong> to <em>c:\users\username\documents\Visual Studio 2012\Addins</em>. [If the Addins folder doesn't exist, create it]</p></li> <li>In Visual Studio 2012, under <strong>Tools</strong> -> <strong>Addin Manager</strong>, Check the box on the left next to <em>AddInName</em>.</li> <li>Restart Visual Studio 2012</li> <li>You should now see the <em>AddInName</em> listed under Tools. [probably with a Smiley face!]</li> <li>When you click on this, it should insert a new GUID at your cursor's location.</li> <li>Map this to a hotkey by navigating to <strong>Tools</strong> -> <strong>Options</strong> -> <strong>Environment</strong> -> <strong>Keyboard</strong>, search for <em>AddInName</em>, and bind a hotkey to it.</li> </ol> <p>Voila! Hotkey GUID generation and a little bit of Visual Studio Add-in know how. :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload