CodeExpressionCollection-Klasse
Stellt eine Auflistung von CodeExpression-Objekten dar.
Namespace: System.CodeDom
Assembly: System (in system.dll)
Syntax
'Declaration
<SerializableAttribute> _
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<ComVisibleAttribute(True)> _
Public Class CodeExpressionCollection
Inherits CollectionBase
'Usage
Dim instance As CodeExpressionCollection
[SerializableAttribute]
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)]
[ComVisibleAttribute(true)]
public class CodeExpressionCollection : CollectionBase
[SerializableAttribute]
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)]
[ComVisibleAttribute(true)]
public ref class CodeExpressionCollection : public CollectionBase
/** @attribute SerializableAttribute() */
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */
/** @attribute ComVisibleAttribute(true) */
public class CodeExpressionCollection extends CollectionBase
SerializableAttribute
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)
ComVisibleAttribute(true)
public class CodeExpressionCollection extends CollectionBase
Hinweise
Stellt ein einfaches Auflistungsobjekt bereit, das eine Reihe von CodeDOM-Ausdrucksobjekten darstellen kann.
Die CodeExpressionCollection-Klasse stellt ein einfaches Auflistungsobjekt dar, das zum Speichern einer Reihe von CodeExpression-Objekten verwendet werden kann.
Beispiel
' Creates an empty CodeExpressionCollection.
Dim collection As New CodeExpressionCollection()
' Adds a CodeExpression to the collection.
collection.Add(New CodePrimitiveExpression(True))
' Adds an array of CodeExpression objects to the collection.
Dim expressions As CodeExpression() = {New CodePrimitiveExpression(True), New CodePrimitiveExpression(True)}
collection.AddRange(expressions)
' Adds a collection of CodeExpression objects to the collection.
Dim expressionsCollection As New CodeExpressionCollection()
expressionsCollection.Add(New CodePrimitiveExpression(True))
expressionsCollection.Add(New CodePrimitiveExpression(True))
collection.AddRange(expressionsCollection)
' Tests for the presence of a CodeExpression in the
' collection, and retrieves its index if it is found.
Dim testComment = New CodePrimitiveExpression(True)
Dim itemIndex As Integer = -1
If collection.Contains(testComment) Then
itemIndex = collection.IndexOf(testComment)
End If
' Copies the contents of the collection beginning at index 0 to the specified CodeExpression array.
' 'expressions' is a CodeExpression array.
collection.CopyTo(expressions, 0)
' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count
' Inserts a CodeExpression at index 0 of the collection.
collection.Insert(0, New CodePrimitiveExpression(True))
' Removes the specified CodeExpression from the collection.
Dim expression = New CodePrimitiveExpression(True)
collection.Remove(expression)
' Removes the CodeExpression at index 0.
collection.RemoveAt(0)
// Creates an empty CodeExpressionCollection.
CodeExpressionCollection collection = new CodeExpressionCollection();
// Adds a CodeExpression to the collection.
collection.Add( new CodePrimitiveExpression(true) );
// Adds an array of CodeExpression objects to the collection.
CodeExpression[] expressions = { new CodePrimitiveExpression(true), new CodePrimitiveExpression(true) };
collection.AddRange( expressions );
// Adds a collection of CodeExpression objects to the collection.
CodeExpressionCollection expressionsCollection = new CodeExpressionCollection();
expressionsCollection.Add( new CodePrimitiveExpression(true) );
expressionsCollection.Add( new CodePrimitiveExpression(true) );
collection.AddRange( expressionsCollection );
// Tests for the presence of a CodeExpression in the
// collection, and retrieves its index if it is found.
CodeExpression testComment = new CodePrimitiveExpression(true);
int itemIndex = -1;
if( collection.Contains( testComment ) )
itemIndex = collection.IndexOf( testComment );
// Copies the contents of the collection beginning at index 0 to the specified CodeExpression array.
// 'expressions' is a CodeExpression array.
collection.CopyTo( expressions, 0 );
// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;
// Inserts a CodeExpression at index 0 of the collection.
collection.Insert( 0, new CodePrimitiveExpression(true) );
// Removes the specified CodeExpression from the collection.
CodeExpression expression = new CodePrimitiveExpression(true);
collection.Remove( expression );
// Removes the CodeExpression at index 0.
collection.RemoveAt(0);
// Creates an empty CodeExpressionCollection.
CodeExpressionCollection^ collection = gcnew CodeExpressionCollection;
// Adds a CodeExpression to the collection.
collection->Add( gcnew CodePrimitiveExpression( true ) );
// Adds an array of CodeExpression objects to the collection.
array<CodeExpression^>^expressions = {gcnew CodePrimitiveExpression( true ),gcnew CodePrimitiveExpression( true )};
collection->AddRange( expressions );
// Adds a collection of CodeExpression objects to the collection.
CodeExpressionCollection^ expressionsCollection = gcnew CodeExpressionCollection;
expressionsCollection->Add( gcnew CodePrimitiveExpression( true ) );
expressionsCollection->Add( gcnew CodePrimitiveExpression( true ) );
collection->AddRange( expressionsCollection );
// Tests for the presence of a CodeExpression in the
// collection, and retrieves its index if it is found.
CodeExpression^ testComment = gcnew CodePrimitiveExpression( true );
int itemIndex = -1;
if ( collection->Contains( testComment ) )
itemIndex = collection->IndexOf( testComment );
// Copies the contents of the collection beginning at index 0 to the specified CodeExpression array.
// 'expressions' is a CodeExpression array.
collection->CopyTo( expressions, 0 );
// Retrieves the count of the items in the collection.
int collectionCount = collection->Count;
// Inserts a CodeExpression at index 0 of the collection.
collection->Insert( 0, gcnew CodePrimitiveExpression( true ) );
// Removes the specified CodeExpression from the collection.
CodeExpression^ expression = gcnew CodePrimitiveExpression( true );
collection->Remove( expression );
// Removes the CodeExpression at index 0.
collection->RemoveAt( 0 );
// Creates an empty CodeExpressionCollection.
CodeExpressionCollection collection = new CodeExpressionCollection();
// Adds a CodeExpression to the collection.
collection.Add(new CodePrimitiveExpression(
System.Convert.ToString(true)));
// Adds an array of CodeExpression objects to the collection.
CodeExpression expressions[] = { new CodePrimitiveExpression(
System.Convert.ToString(true)), new CodePrimitiveExpression(
System.Convert.ToString(true)) };
collection.AddRange(expressions);
// Adds a collection of CodeExpression objects to the collection.
CodeExpressionCollection expressionsCollection = new
CodeExpressionCollection();
expressionsCollection.Add(new CodePrimitiveExpression(
System.Convert.ToString(true)));
expressionsCollection.Add(new CodePrimitiveExpression(
System.Convert.ToString(true)));
collection.AddRange(expressionsCollection);
// Tests for the presence of a CodeExpression in the
// collection, and retrieves its index if it is found.
CodeExpression testComment = new CodePrimitiveExpression(System.
Convert.ToString(true));
int itemIndex = -1;
if (collection.Contains(testComment)) {
itemIndex = collection.IndexOf(testComment);
}
// Copies the contents of the collection beginning at index 0 to
//the specified CodeExpression array.
// 'expressions' is a CodeExpression array.
collection.CopyTo(expressions, 0);
// Retrieves the count of the items in the collection.
int collectionCount = collection.get_Count();
// Inserts a CodeExpression at index 0 of the collection.
collection.Insert(0, new CodePrimitiveExpression(System.Convert.
ToString(true)));
// Removes the specified CodeExpression from the collection.
CodeExpression expression = new CodePrimitiveExpression(System.Convert.
ToString(true));
collection.Remove(expression);
// Removes the CodeExpression at index 0.
collection.RemoveAt(0);
Vererbungshierarchie
System.Object
System.Collections.CollectionBase
System.CodeDom.CodeExpressionCollection
Threadsicherheit
Alle öffentlichen statischen (Shared in Visual Basic) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.
Plattformen
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
CodeExpressionCollection-Member
System.CodeDom-Namespace
CodeExpression-Klasse