Visual Studio add-on gallery? - visual-studio

i'm hoping to find some add-ons for Visual Studio to address some specific usability issues. Is there a Visual Studio addons gallery that contains a huge dumping ground of addons that every person, company, yahoo and hick have created?
Kind of like Vista Sidebar Gadget gallery, but for addons.
Kind of like CodePlex, but for addons.
Is Visual Studio Gallery it?
Not that it's important to my question, but some of the IDE functionality i was hoping to see addressed through addons:
tabs are placed in chronological open order
renaming a control renames attached event handlers
deleting all code from an event handler deletes and unhooks the event handler
deleting an event handler unhooks it
rearrange code so private, protected and public methods and grouped. Properties and events are grouped. Private variables are grouped.
analyse for using lint
controls that have been cut/pasted have their event handlers functional
full support for B.R.I.E.F. bookmarks (found it)
/// automatically adds thrown exceptions
/// comments are rendered on the item their declared for

You may be looking for this

Have you checked the MSDN Code Gallery?

Related

Unbind/unsynchronized scrolling in source control compare function

In compare option inside the source control, the scrolling is bind together for both files.
I want to scroll just one of the sides while the other stay pinned also I want to avoid comparing outside on the VS.
I can't find any solution online and there is no obvious option in the VS.
I'm Using VS2015 with TFS.
Thank you.
EDIT
New feature request for microsoft was opened
Feature request
EDIT
In VS1029 Version 16.11.3 feature exist, by pressing it you can unbind the windows
In compare option inside the source control, the scrolling is bind
together for both files.
For this , I am afraid this is by designed. The same is true for my test in visual studio2019.
You could add your request for this feature on our UserVoice site , which is our main forum for product suggestions. After suggest raised, you can vote and add your comments for this feedback. The product team would provide the updates if they view it.

Visual Studio Sidebar Navigation

I am looking for free extension that has one simple functionality which is sidebar file navigation like is in SuperCharger or Resharper (see attached screenshots). Sadly both of them are paid :-( Does anyone have a good alternative?
Visual studio has Class View window for a quite a while.
You can try Productivity Power Tools, with it, you can:
Expand code files to navigate to its classes, expand classes to navigate to their members, and so on (C# and VB only)
Search your solution, all the way down to class members
Filter your solution or projects to see just opened files, unsaved files, and so on
View related information about classes and members (such as references or callers/callees for C#)
Preview images by hovering over them, or preview rich information by hovering over code items
We've also added support for multiple selection and drag & drop.
https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProductivityPowerTools
I know its an old question, but as i was looking for an alternative to supercharger // Resharper (for the navigation only) few days ago, and had looked on stack before doing my search (and as I found the answers not exactly what i was looking for) ...
After testing a few extensions I finally found a good alternative to those two paid solutions :
https://github.com/sboulema/CodeNav/blob/master/README.md
You can also just download it from the extensions menu , search for CodeNav .
Best.

Disable Own Word 2007 Add-In If No Document Loaded

I've developed an application-level add-in for Word 2007 using Visual Studio 2010 and .NET 3.5. Part of what it does is use the
Globals.ThisAddIn.Application.Selection.Range
to insert text.
However, when there is no document loaded this code fails. I could catch the exception or programmatically detect whether a document was currently open, but I think there must be an easier way...
When Word 2007 is open but no document is loaded, most of the buttons on the ribbon are disabled (that is, greyed out).
Any idea how this is achieved?
Will the add-ins hook into an event and disable their buttons accordingly?
If so, would this be the
DocumentBeforeClose
event, and could this be risky if Word is somehow opened without a document? (That is, there's no document loaded, but the event hasn't yet been triggered.)
Thanks in advance!
UPDATE:
OK, it seems like making use of the
getEnabled="MyMethod"
attribute of the XML might be the way forward, but this seems to only work for the individual controls on the Ribbon rather than the whole ribbon itself.
You basically answered your own question.
I could catch the exception or
programmatically detect whether a
document was currently open
Catching the exception is a bit nasty, but would work.
Programmatically detecting whether there is a document loaded is the best alternative.
And it's easy.
If Globals.ThisAddIn.Application.Documents.Count > 0 then
'at least one document is opened
end if
Can't get much easier than that.
Is there something else you were trying to accomplish with the stuff about the buttons on the ribbon?
Try using the DocumentChange event instead (see my answer on this thread).

Where should I attach solution or project events in my Visual Studio add-in?

Can anyone suggest the best place to add solution or project events, such as ProjectAdded, to a Visual Studio add-in?
If I do this when the add-in connects then there's no solution loaded, so how can I tell when a solution has been loaded?
For example, if I write an event to handle project items being added, where should I attach this? The event would be fired by the project, and that in turn by the solution, so I can't attach the events when the add-in connects because there is no solution when the add-in connects.
On the other hand, if I add them in the Exec() event then I need to do checks such as whether the event has been attached already, and I'm sure there must be a neater way sometime between the connection events and the Exec() event.
You probably figured this out long ago, but anyway: You can setup your events from within OnConnection like shown below, this is a snippet of an Addin's Connect class (assuming you're using c#):
using System;
using System.Globalization;
using System.Reflection;
using System.Resources;
using EnvDTE;
using EnvDTE80;
using Extensibility;
using Microsoft.VisualStudio.CommandBars;
namespace MyAddin1
{
/// <summary>The object for implementing an Add-in.</summary>
/// <seealso class='IDTExtensibility2' />
public class Connect : IDTExtensibility2, IDTCommandTarget
{
private DTE2 _applicationObject;
private AddIn _addInInstance;
private SolutionEvents _solutionEvents;
public void OnConnection(object application, ext_ConnectMode connectMode,
object addInInst, ref Array custom)
{
_applicationObject = (DTE2)application;
_addInInstance = (AddIn)addInInst;
// check the value of connectMode here, depending on your scenario
if(connectMode == ...)
SetupEvents();
}
private void SetupEvents()
{
// this is important ...
_solutionEvents = _applicationObject.Events.SolutionEvents;
// wire up the events you need
_solutionEvents.Opened += new _dispSolutionEvents_OpenedEventHandler(_solutionEvents_Opened);
_solutionEvents.AfterClosing += new _dispSolutionEvents_AfterClosingEventHandler(_solutionEvents_AfterClosing);
_solutionEvents.ProjectAdded += new _dispSolutionEvents_ProjectAddedEventHandler(_solutionEvents_ProjectAdded);
}
// add procedures to handle the events here, plus any other
// handling you need, ie. OnDisconnection and friends
}
The main point is, to wire up the solution and project events you need, it's not important if a solution or project is already loaded. They're not attached to any particular solution or project, they're provided by the Visual Studio object model and are embedded within the EnvDTE namespace.
It wouldn't make much sense to do anything else anyway, since you can configure an addin to load when VS starts, and in this case there will never ever be any solutions/projects loaded.
There's a few catches though:
It's important that you keep a reference to the SolutionEvents class as a member variable within your connect class, otherwise the events will never fire, (see also here).
You need to make sure you check the connectMode parameter passed into OnConnection. This gets called multiple times with different parameters, and if you do it the wrong way you may get the event wired up multiple times, which definetly will be a problem. Also, usually any Addin IDE, like Menus and stuff, is set up from within OnConnection, so you may end up with duplicate menu items if you don't do it right.
Here's a few pointers, some of the code provided is VB code, in case you're looking for that:
HOWTO: Adding buttons, commandbars and toolbars to Visual Studio .NET from an add-in
HOWTO: Getting Project and ProjectItem events from a Visual Studio .NET add-in.
HOWTO: Add an event handler from a Visual Studio add-in
Finally, here's a list of articles, about 70% of them cover basic and advanced topics regarding addins:
Resources about Visual Studio .NET extensibility
Find the section entitled MZ-Tools Articles Series (about add-ins) and have a look at what's covered there.

Browsing Classes, Objects, etc

Question ONE:
I'm still pretty new to .net, but have used Visual Studio for a few recent projects. I'm now working a new project and I was wondering if visual studio had anything built in that would allow you to browse all of the details about a control, etc..
Is MSDN the best place to go for this?
For instance if I wanted to see of all the methods, properties, etc.. Is there anything inside VS?
Question TWO:
Can anyone recommend, books, resources, that deal specificially with Visual Studio? What each window does, etc.. I have used it enough to complete a few projects, but I haven't seen much in the way of exactly what everything does and why.
Thanks for any suggestions.
Use reflector (it's free!) to get in-depth information about classes etc. Visual studio also has a built-in Object Browser.
P.S. Reflector allows you to reverse engineer assemblies as well, allowing you to view the actual code of a class / method.
P.P.S. Google is still a developer's best friend. Need information on a control, search for it on the web. (Which will lead you to MSDN a lot of the times, but will also get you examples and loads of blog entries).
Question ONE:
You can use the Object Browser (menu View\Object Browser) to see a hierarchical list of all known assemblies, classes, interfaces, enums, etc...
This only gives the signature of each item and not the code.
If you want to see the code, use .Net reflector.
You can also use the Object Browser in Visual Studio. There is usually an icon for it at the top (by the Toolbox, Solution Explorer, etc. icons) or you can navigate to it (View -> Object Browser). When it opens, you will see all of the libraries currently referenced (system and third party) on the left hand side. It's hierarchical, so you can start drilling down. There is a search box at the top, if you want to look for a particular class, method or library. That looks at all the system libraries, not just the ones referenced in your current project.
For more help with the object browser, look here.
Q1:
In Visual Studio:
Above the editor there are 2 dropdown lists:
Left: Shows Classes
Right: Shows Class Members
or Click View > Class View: to see all the classes in the whole solution
I had a similar rub when I started using VS after I had done a lot of Java coding. I was used to the Java API documentation to research properties and such.
I found the VS equivalent IMO, here:
http://msdn.microsoft.com/en-us/library/ms229335.aspx
You can browse every class method, property, constructor, etc. right there. Their examples are decent.
In response to question 1, what I usually do is highlight the bit of framework code I'm interested in and hit F1 to bring up the documentation. For example:
Button myButton = new Button();
If you highlight the first Button and hit F1, you'll get an overview on Buttons in Windows Forms. If you highlight Button() and hit F1 you'll get the documentation on the Button class constructor.
In response to question 2, I'm not sure a book is the answer. I think reading a book on all the components of Visual Studio might be overkill. I'd say to keep on hacking away at your projects and page-fault information in via MSDN, Google, and StackOverflow as you need it. As with any IDE and framework, the more you use it the better you'll get at navigating and learning the ins and outs.

Resources