Export (0) Print
Expand All

GeneratedCodeAttribute Class

Identifies code generated by a tool. This class cannot be inherited.

Namespace: System.CodeDom.Compiler
Assembly: System (in system.dll)

'Declaration
<AttributeUsageAttribute(AttributeTargets.All, Inherited:=False, AllowMultiple:=False)> _
Public NotInheritable Class GeneratedCodeAttribute
	Inherits Attribute
'Usage
Dim instance As GeneratedCodeAttribute

/** @attribute AttributeUsageAttribute(AttributeTargets.All, Inherited=false, AllowMultiple=false) */ 
public final class GeneratedCodeAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.All, Inherited=false, AllowMultiple=false) 
public final class GeneratedCodeAttribute extends Attribute
Not applicable.

The GeneratedCodeAttribute class can be used by code analysis tools to identify computer-generated code, and to provide an analysis based on the tool and the version of the tool that generated the code.

The following code example shows the use of the GeneratedCodeAttribute class to identify computer-generated code.

CodeAttributeDeclaration generatedCodeAttribute = new      CodeAttributeDeclaration(
typeof(System.CodeDom.Compiler.GeneratedCodeAttribute).FullName, 
new CodeAttributeArgument(Str("TypedDataSetGenerator")), 
new CodeAttributeArgument(Str("2.0.0.0")));
typeDeclaration.CustomAttributes.Add(generatedCodeAttribute);
Dim generatedCodeAttribute As New CodeAttributeDeclaration( _
    GetType(System.CodeDom.Compiler.GeneratedCodeAttribute).FullName, _
    New CodeAttributeArgument(New CodePrimitiveExpression("TypedDataSetGenerator")), _
    New CodeAttributeArgument(New CodePrimitiveExpression("2.0.0.0"))) nodeClass.CustomAttributes.Add(generatedCodeAttribute)

System.Object
   System.Attribute
    System.CodeDom.Compiler.GeneratedCodeAttribute

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

.NET Compact Framework

Supported in: 2.0

XNA Framework

Supported in: 1.0

Community Additions

ADD
Show:
© 2014 Microsoft