System.CodeDom.CodeSnippetCompileUnit Class

Assembly: System.dll
Namespace: System.CodeDom
Summary
Represents a literal code fragment that can be compiled.
C# Syntax:
[Serializable]
public class CodeSnippetCompileUnit : CodeCompileUnit
Remarks
CodeSnippetCompileUnit can represent a literal block of code that is included directly in the source without modification.

A CodeSnippetCompileUnit stores a section of code, exactly in its original format, as a string. The CodeDOM does not translate literal code fragments. Literal code fragments are stored and output in their original format. CodeDOM objects that contain literal code are provided so developers can encapsulate code that is already in the target language.

See also:
System.CodeDom Namespace

System.CodeDom.CodeSnippetCompileUnit Member List:

Public Constructors
ctor #1 Initializes a new instance of the CodeSnippetCompileUnit class.
Public Properties
AssemblyCustomAttributes
(inherited from System.CodeDom.CodeCompileUnit)
Read-only

See base class member description: System.CodeDom.CodeCompileUnit.AssemblyCustomAttributes


Gets a collection of custom attributes for the collection of assemblies.
LinePragma Read-write

Gets or sets the line and file information about where the code is located in a source code document.
Namespaces
(inherited from System.CodeDom.CodeCompileUnit)
Read-only

See base class member description: System.CodeDom.CodeCompileUnit.Namespaces


Gets the collection of namespaces.
ReferencedAssemblies
(inherited from System.CodeDom.CodeCompileUnit)
Read-only

See base class member description: System.CodeDom.CodeCompileUnit.ReferencedAssemblies


Gets the referenced assemblies.
UserData
(inherited from System.CodeDom.CodeObject)
Read-only

See base class member description: System.CodeDom.CodeObject.UserData


Gets or sets the user-definable data for the current object.
Value Read-write

Gets or sets the literal code fragment to represent.
Public Methods
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.CodeDom.CodeSnippetCompileUnit Member Details

ctor #1
Summary
Initializes a new instance of the CodeSnippetCompileUnit class.
C# Syntax:
public CodeSnippetCompileUnit(
   string value
);
Parameters:

value

The literal code fragment to represent.

Return to top


Property: AssemblyCustomAttributes (read-only)
Inherited
See base class member description: System.CodeDom.CodeCompileUnit.AssemblyCustomAttributes

Summary
Gets a collection of custom attributes for the collection of assemblies.
C# Syntax:
public CodeAttributeDeclarationCollection AssemblyCustomAttributes {get;}

Return to top


Property: LinePragma (read-write)
Summary
Gets or sets the line and file information about where the code is located in a source code document.
C# Syntax:
public CodeLinePragma LinePragma {get; set;}
See also:
CodeLinePragma

Return to top


Property: Namespaces (read-only)
Inherited
See base class member description: System.CodeDom.CodeCompileUnit.Namespaces

Summary
Gets the collection of namespaces.
C# Syntax:
public CodeNamespaceCollection Namespaces {get;}
Remarks
Some languages support only a single namespace that contains a single class in a compile unit.
See also:
CodeNamespaceCollection

Return to top


Property: ReferencedAssemblies (read-only)
Inherited
See base class member description: System.CodeDom.CodeCompileUnit.ReferencedAssemblies

Summary
Gets the referenced assemblies.
C# Syntax:
public StringCollection ReferencedAssemblies {get;}

Return to top


Property: UserData (read-only)
Inherited
See base class member description: System.CodeDom.CodeObject.UserData

Summary
Gets or sets the user-definable data for the current object.
C# Syntax:
public IDictionary UserData {get;}
Remarks


Notes to inheritors: An inheritor can design the way this user data is stored, retrieved, and used.

Return to top


Property: Value (read-write)
Summary
Gets or sets the literal code fragment to represent.
C# Syntax:
public string Value {get; set;}

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~CodeSnippetCompileUnit();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.