Home Screenshots Download Order Blog* Support
User Guide Style Tab Grouping Add-ins FAQ

Add-ins

Using add-ins

Tabs Studio supports custom add-ins that can extend Tabs Studio functionality and interact with the Visual Studio shell. Add-in dlls are loaded from the Add-in installation folder at startup. The Add-in Manager window can be opened from the Tabs Studio toolbar, using the tab context menu or TabsStudio.Connect.Addins command. It displays all downloaded add-ins, if a started add-in supports configuration options the Options button is displayed:

Tabs Studio Add-in Manager

To install a new add-in:

  1. Open Add-in Manager.
  2. Click Add-in installation folder.
  3. Copy an add-in dll to the opened folder.
  4. Re-open Add-in Manager, check the new add-in for Startup and Save.

If an add-in is not visible in Add-in Manager check whether it is blocked as downloaded from the Internet.

Preinstalled add-ins (with source code)

AfterClose v1.0.2 - activates the next tab (instead of the last selected document) after closing the active one.

AutoOpener v1.0.9 - automatically opens corresponding files. Read more...

AvalonStyleEditor v1.0.2 - extends style editors in Tabs Studio with syntax highlighting, a color picker and additional commands. Read more...

CloseClick v1.0.1 - close a tab by double-click.

CloseRight v1.0.0 - adds a context menu command to close all tabs to the right of the selected tab.

Disambiguator v1.1.0 - detects when two or more tabs have the same title and adds Visual Studio folder or project to titles for these tabs. Read more...

ITransform v1.0.3 - creates custom tab titles for prefix grouped files. Read more...

Localizer v1.0.0 - tab context menu translation for German and Spanish localized Visual Studio editions. Read more...

Marker v1.2.0 - highlights tabs with Ctrl+Click. Read more...

MRU v1.0.0 - sorts the tabs in the most recently used way.

MvcGroup v1.0.2 - groups ASP.NET MVC controller and view tabs near each other (a controller is placed before views). Also adds IsController, IsView and GroupName properties for coloring. Read more...

Navigator v1.1.9 - provides additional Visual Studio commands to switch tabs using keyboard. Read more...

NewGroup v1.0.9 - adds New horizontal/vertical tab group commands to the Tabs Studio context menu.

OpenAll v1.0.1 - adds a new context menu command to open all available corresponding files at once.

OpenDesigner v1.0.1 - adds a context menu command to open a corresponding [Design] view.

OpenNext v1.0.2 - changes default placement for a new tab from the right end to the right of the active tab.

OrderKeeper v1.0.0 - maintains order when a tab is closed and reopened. Read more...

OrderEx v1.0.2 - reorders extensions in a tab. By default places .h before .cpp.

PriorityGroup v1.0.5 - places important tabs to the beginning. Read more...

RestoreToolbar v1.0.0 - adds the Restore Toolbar command to the tab context menu.

Saver v1.1.1 - restores tabs order when opening a solution to the last state. Read more...

Selector v1.0.0 - highlights tabs for the selected project. Read more...

Shaper v1.0.4 - adds the customizable TabShape control specialized for trapezoid tabs. See Visual Studio 2008 style and Chrome style as examples that use this add-in. Read more...

SingleRow v1.0.8 - limits the maximum number of tab rows and shows remaining tabs in a drop-down list. Read more...

Sorter v1.1.3 - automatically sorts tabs by project, name, highlight index etc. Read more...

SQLComment v1.0.7 - adds an SQL query description to the SSMS tab name. Read more...

SuperCommands v1.0.0 - adds Close super group and Close all but this super group tab context menu commands. Read more...

SuperName v1.0.1 - adds the corresponding project name to the first tab in each super group. Read more...

Sync v1.1.0 - adds a new command to the Tabs Studio context menu to locate a document in the Solution Explorer window. Read more...

TrackEd v1.0.2 - tracks edits and shows yellow or green bar in the tab title. Read more... Read more2...

XMenu v1.1.1 - adds tab context menu commands from other Visual Studio add-ins. Read more...

Developing add-ins

An add-in for Tabs Studio is a .NET dll. Main add-in class should implement TabsStudioExt.ITabsStudioAddin or TabsStudioExt.ITabsStudioAddin2 interface to be loaded by Tabs Studio at startup:
namespace TabsStudioExt
{
    public interface ITabsStudioAddin
    {
        void OnConnection(ITabsStudioEngine engine, EnvDTE80.DTE2 dte);
        void OnDisconnection();
    }
}
namespace TabsStudioExt
{
    public interface ITabsStudioAddin2
    {
        void OnConnection(ITabsStudioEngine engine, EnvDTE80.DTE2 dte, IVsPackage package);
        void OnDisconnection();
    }
}

The IVsPackage parameter gives access to Visual Studio package interfaces like Microsoft.VisualStudio.Shell.Interop.IVsPackage, System.IServiceProvider etc. It is not null only in Visual Studio 2015+.

Only one add-in per dll is supported. TabsStudioExt interfaces are declared in the TabsStudioExt.dll installed along with the TabsStudio.dll. EnvDTE80.DTE2 parameter in the OnConnection method offers access to the Visual Studio extensibility model. TabsStudioExt.ITabsStudioEngine interface offers Tabs Studio methods and events an add-in can use for Tabs Studio customization (see Tab Studio controls specification for more details):
namespace TabsStudioExt
{
    public interface ITabsStudioEngine
    {
        event TabExtensionCreatedEventHandler TabExtensionCreated;
        event TabExtensionDestroyedEventHandler TabExtensionDestroyed;
        event TabExtensionRenamedEventHandler TabExtensionRenamed;
        event TabCreatedEventHandler TabCreated;
        event TabDestroyedEventHandler TabDestroyed;
        event TabRenamedEventHandler TabRenamed;
        
        event TabsCreatedEventHandler TabsCreated;
        event TabsDestroyedEventHandler TabsDestroyed;
        event OpeningTabContextMenuEventHandler OpeningTabContextMenu;
        event OpeningTabExtensionContextMenuEventHandler OpeningTabExtensionContextMenu;
        event ClosingSingleTabEventHandler ClosingSingleTab;
        event ClosingSingleTabExtensionEventHandler ClosingSingleTabExtension;
        event System.EventHandler Initialize;
        System.Collections.Generic.List<Tabs> GetTabs();
        System.Collections.Generic.List<Tabs> ReturnTabs();
        EnvDTE.AddIn GetAddIn();
        Settings GetSettings();
        void UpdatePresentationStyles(string key, Presentation presentation);
	System.Collections.Generic.List<string> GetCorrespondingFiles(System.Windows.Controls.TabItem tab);
	string GetAddinSettingsDirectory();
    }
}
Sample add-in solution structure

Using Visual Studio and C#, start creating an add-in from the C# class library template project. References to EnvDTE and EnvDTE80 are needed to use the DTE2 parameter in the OnConnection method. PresentationCore, PresentationFramework and WindowsBase are needed to work with WPF controls. TabsStudioExt defines all Tabs Studio extensibility interfaces.

To execute custom Visual Studio commands and set commands availability status your main add-in class must implement the EnvDTE.IDTCommandTarget interface (Exec and QueryStatus methods):

public class Navigator : TabsStudioExt.ITabsStudioAddin, EnvDTE.IDTCommandTarget
To support configurability add-in's main class must implement the TabsStudioExt.IConfigurable interface:
public class SingleRow : TabsStudioExt.ITabsStudioAddin, TabsStudioExt.IConfigurable
Add-in information for Add-in Manager is extracted from the version resource in the add-in dll file. Add-in name is extracted from the ProductName key, in C# project it is set using the AssemblyProduct attribute. Description is extracted from the FileDescription key defined by the AssemblyTitle attribute. Version is extracted from the ProductVersion key defined by the AssemblyFileVersion attribute.

To change tab title from an add-in use the TitleManager property in TabsStudioExt.Tab and TabsStudioExt.TabExtension classes. An add-in can modify the regex transforms list and call the ApplyTransforms method.

To define custom properties for styling, an add-in can use WPF Attached Properties and implement the TabsStudioExt.IStyler interface returning a string with required additional namespace definitions:
public string GetNamespacesForResourceDictionary()
{
    return "xmlns:TabsStudioMvcGroup=\"clr-namespace:TabsStudioMvcGroup;assembly=MvcGroup\"";
}
An add-in can add, remove and modify menu items in the Tabs Studio context menu handling OpeningTabContextMenu and OpeningTabExtensionContextMenu events. Right click on a tab with a single extension generates the OpeningTabExtensionContextMenu event. To simplify customization from an add-in, each menu item and separator in the default context menu has distinct Name. For document tab context menu, the names are: Open, OpenSeparator, Save, SaveSeparator, Close, CloseAllButThis, CloseAllDocuments, FileSeparator, CopyFullPath, OpenContainingFolder, VS2010DocumentSeparator, VS2010Floating, FloatAll, VS2010Dockable, TabGroupsSeparator, MoveToNextTabGroup, MoveAllToNextTabGroup, MoveToPreviousTabGroup, MoveAllToPreviousTabGroup, TabsStudioSeparator, SetColor and TabsStudio. For non-document tab context menu, additional names are: WindowSeparator, Floating, FloatAll, Dockable, TabbedDocument, AutoHide and Hide.

The UpdatePresentationStyles method is used to update styles dynamically from an add-in. Triggers and setters for default Tabs Studio controls are added to the Styles property. For new controls (like TabsStudioSingleRow:HiddenTabs) a style resource and a default style usage are provided in the Presentation constructor. The style parameter in the Presentation constructor can also add static resources for use in tab coloring rules. Theoretically it may be a custom brush or a generated color:

private void UpdatePresentationStyle()
{
    TabsStudioExt.Presentation presentation = new TabsStudioExt.Presentation(
        LoadString("HiddenTabsStyle.xml"), LoadString("HiddenTabsUsage.xml"));
    {
        TabsStudioExt.PresentationStyle style = new TabsStudioExt.PresentationStyle();
        style.Triggers.Add(LoadString("TabTriggers.xml"));
        presentation.Styles.Add("TabsStudio:Tab", style);
    }
    {
        TabsStudioExt.PresentationStyle style = new TabsStudioExt.PresentationStyle();
        style.Setters.Add(LoadString("TabsHostTemplate.xml"));
        presentation.Styles.Add("TabsStudio:TabsHost", style);
    }
    engine.UpdatePresentationStyles("SingleRow", presentation);
}

To debug an add-in using Visual Studio:

  1. Remove your add-in from the TabsStudioAddins directory and start VS.
  2. In your add-in project set the Build - Output path to your TabsStudioAddins directory (e.g. C:\Users\myadmin\Documents\Visual Studio 2008\Addins\TabsStudioAddins).
  3. In your add-in project set Debug - Start external program to VS (e.g. C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe).
  4. Start Debugging as usual.
To debug an add-in in Visual Studio 2010 SP1 retarget it for .NET 4 or set .NET 4 startup project.