Update of /cvsroot/mvp-xml/Design/v1/src/CustomTools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10533/v1/src/CustomTools
Added Files:
Attributes.cs
Log Message:
Set of attributes to use for easy development and registration of custom tools. Includes the visual studio version to support as well as the language.
--- NEW FILE: Attributes.cs ---
#region using
using System;
#endregion using
namespace Mvp.Xml.Design.CustomTools
{
#region CustomToolAttribute
/// <summary>
/// Specifies custom tool registration information.
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class CustomToolAttribute : Attribute
{
/// <summary>
/// Assigns custom tool information to the class.
/// </summary>
/// <param name="name">Name of the custom tool.</param>
/// <param name="description">A description of the tool.</param>
/// <param name="generatesDesignTimeCode">
/// If <see langword="true" />, the IDE will try to compile on the fly the
/// dependent the file associated with this tool, and make it available
/// through intellisense to the rest of the project.
/// </param>
public CustomToolAttribute(string name, string description, bool generatesDesignTimeCode)
{
_name = name;
_description = description;
_code = generatesDesignTimeCode;
}
/// <summary>
/// Name of the custom tool.
/// </summary>
public string Name
{
get { return _name; }
} string _name;
/// <summary>
/// Friendly description of the tool.
/// </summary>
public string Description
{
get { return _description; }
} string _description;
/// <summary>
/// Specifies whether the tool generates design time code to compile on the fly.
/// </summary>
public bool GeneratesDesignTimeCode
{
get { return _code; }
} bool _code;
}
#endregion CustomToolAttribute
#region VersionSupportAttribute
/// <summary>
/// Determines which versions of VS.NET are supported by the custom tool.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple=true)]
public class VersionSupportAttribute : Attribute
{
/// <summary>
/// Initializes the attribute.
/// </summary>
/// <param name="version">Version supported by the tool.</param>
public VersionSupportAttribute(string version)
{
_version = new Version(version);
}
/// <summary>
/// Version supported by the tool.
/// </summary>
public Version Version
{
get { return _version; }
} Version _version;
}
#endregion VersionSupportAttribute
#region CategorySupportAttribute
/// <summary>
/// Determines which VS.NET generator categories are supported by the custom tool.
/// This class also contains constants for C# and VB.NET category guids.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple=true)]
public class CategorySupportAttribute : Attribute
{
/// <summary>
/// VS Generator Category for C# Language.
/// </summary>
public const string CSharpCategory = "{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}";
/// <summary>
/// VS Generator Category for VB Language.
/// </summary>
public const string VBCategory = "{164B10B9-B200-11D0-8C61-00A0C91E29D5}";
/// <summary>
/// Initializes the attribute.
/// </summary>
/// <param name="categoryGuid">
/// Either <see cref="CSharpCategory"/> or <see cref="VBCategory"/>.
/// </param>
public CategorySupportAttribute(string categoryGuid)
{
_category = new Guid(categoryGuid);
}
/// <summary>
/// The identifier of the supported category.
/// </summary>
public Guid Guid
{
get { return _category; }
} Guid _category;
}
#endregion CategorySupportAttribute
}
|