GeneratorAttribute Class

Identifies a class as a data generator.

Namespace: Microsoft.VisualStudio.TeamSystem.Data.DataGenerator
Assembly: Microsoft.VisualStudio.TeamSystem.Data (in microsoft.visualstudio.teamsystem.data.dll)

Syntax

'Declaration
<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple:=False, Inherited:=True)> _
<CLSCompliantAttribute(True)> _
Public NotInheritable Class GeneratorAttribute
    Inherits Attribute
'Usage
Dim instance As GeneratorAttribute
[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=false, Inherited=true)] 
[CLSCompliantAttribute(true)] 
public sealed class GeneratorAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Class, AllowMultiple=false, Inherited=true)] 
[CLSCompliantAttribute(true)] 
public ref class GeneratorAttribute sealed : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=false, Inherited=true) */ 
/** @attribute CLSCompliantAttribute(true) */ 
public final class GeneratorAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=false, Inherited=true) 
CLSCompliantAttribute(true) 
public final class GeneratorAttribute extends Attribute

Remarks

GeneratorAttribute is used to specify the designer that the data generator uses. The Generator abstract base class has the GeneratorAttribute and specifies the DefaultGeneratorDesigner.

You should use the GeneratorAttribute in the following case:

  • You want a data generator to use a custom designer.

You should not use the GeneratorAttribute in the following cases:

  • Your data generator class inherits from Generator and you want to use the DefaultGeneratorDesigner.

  • Your data generator class inherits from another data generator class that is already decorated with GeneratorAttribute and you are satisfied with the designer already specified.

Example

The following example demonstrates how to decorate a class with the GeneratorAttribute. In this example, the data generator is associated with a custom designer that is named CustomDesignerType.

[Generator(typeof(CustomDesignerType))]
public class TestGenerator:Generator
{
}
<Generator(GetType(CustomDesignerType))> _
Public Class TestGenerator
    Inherits Generator

End Class

Inheritance Hierarchy

System.Object
   System.Attribute
    Microsoft.VisualStudio.TeamSystem.Data.DataGenerator.GeneratorAttribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Tasks

How to: Create Custom Data Generators

Reference

GeneratorAttribute Members
Microsoft.VisualStudio.TeamSystem.Data.DataGenerator Namespace
Generator Class
IGenerator
GeneratorInit