Click here to Skip to main content
15,885,244 members
Articles / Programming Languages / XML

Visual Studio Add-in Library

Rate me:
Please Sign up or sign in to vote.
4.15/5 (10 votes)
15 Sep 2010CPOL5 min read 61.6K   924   43  
This library allows you to quickly and simply create add-ins for VS2008 and VS2010 (VS2005?).
using Microsoft.VisualStudio.CommandBars;

namespace VisualStudio.AddInLibrary.Menus
{

  /// <summary>
  /// Describes properties needed for a VS command and it's actions
  /// </summary>
  public class VSCommandInfo
  {
    /// <summary>
    /// default Office bitmap id for menu
    /// </summary>
    int _BitmapResourceId = 59;

    /// <summary>
    /// USe Office "location" for resources ?
    /// </summary>
    bool _UseOfficeResources = true;

    /// <summary>
    /// Command Unique ID
    /// </summary>
    public string UniqueID { get; set; }

    /// <summary>
    /// Object owning this Command
    /// </summary>
    public object Owner { get; set; }

    /// <summary>
    /// Command name 
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// Command caption
    /// </summary>
    public string Caption { get; set; }

    /// <summary>
    /// Command tooltip
    /// </summary>
    public string ToolTip { get; set; }

    /// <summary>
    /// Command position inside menus/submenus
    /// </summary>
    public int Position { get; set; }

    /// <summary>
    /// Add separator ?
    /// </summary>
    public bool HaveSeparator { get; set; }

    /// <summary>
    /// Bitmap resource id for this Command
    /// </summary>
    public int BitmapResourceId
    {
      get { return _BitmapResourceId; }
      set { _BitmapResourceId = value; }
    }
    /// <summary>
    /// Yes = use Office, False= use our resources
    /// </summary>
    public bool UseOfficeResources
    {
      get { return _UseOfficeResources; }
      set { _UseOfficeResources = value; }
    }

    /// <summary>
    /// The code that will be run for a command
    /// </summary>
    public PerformActionForVSCommandDelegate Action { get; set; }


    /// <summary>
    /// Visual studio Command Control object
    /// </summary>
    public CommandBarControl Control { get; set; }
  }


}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Program Manager Digitas
France France
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions