This topic has not yet been rated - Rate this topic

GeneratorAttribute Class

Visual Studio 2005

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 sealed class GeneratorAttribute : 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

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.

[Generator(typeof(CustomDesignerType))]
public class TestGenerator:Generator
{
}
System.Object
   System.Attribute
    Microsoft.VisualStudio.TeamSystem.Data.DataGenerator.GeneratorAttribute
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ