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)


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


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.


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.

public class TestGenerator:Generator
<Generator(GetType(CustomDesignerType))> _
Public Class TestGenerator
    Inherits Generator

End Class

Inheritance Hierarchy


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


GeneratorAttribute Members

Microsoft.VisualStudio.TeamSystem.Data.DataGenerator Namespace




Other Resources

How to: Create Custom Data Generators