CodeParameterDeclarationExpressionCollection Klass
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Representerar en samling CodeParameterDeclarationExpression objekt.
public ref class CodeParameterDeclarationExpressionCollection : System::Collections::CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeParameterDeclarationExpressionCollection : System.Collections.CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeParameterDeclarationExpressionCollection = class
inherit CollectionBase
Public Class CodeParameterDeclarationExpressionCollection
Inherits CollectionBase
- Arv
- Attribut
Exempel
I följande exempel visas hur du använder klassmetoderna CodeParameterDeclarationExpressionCollection . Exemplet skapar en ny instans av klassen och använder metoderna för att lägga till instruktioner i samlingen, returnera deras index och lägga till eller ta bort attribut på en specifik indexpunkt.
// Creates an empty CodeParameterDeclarationExpressionCollection.
CodeParameterDeclarationExpressionCollection collection = new CodeParameterDeclarationExpressionCollection();
// Adds a CodeParameterDeclarationExpression to the collection.
collection.Add( new CodeParameterDeclarationExpression(typeof(int), "testIntArgument") );
// Adds an array of CodeParameterDeclarationExpression objects
// to the collection.
CodeParameterDeclarationExpression[] parameters = { new CodeParameterDeclarationExpression(typeof(int), "testIntArgument"), new CodeParameterDeclarationExpression(typeof(bool), "testBoolArgument") };
collection.AddRange( parameters );
// Adds a collection of CodeParameterDeclarationExpression objects
// to the collection.
CodeParameterDeclarationExpressionCollection parametersCollection = new CodeParameterDeclarationExpressionCollection();
parametersCollection.Add( new CodeParameterDeclarationExpression(typeof(int), "testIntArgument") );
parametersCollection.Add( new CodeParameterDeclarationExpression(typeof(bool), "testBoolArgument") );
collection.AddRange( parametersCollection );
// Tests for the presence of a CodeParameterDeclarationExpression
// in the collection, and retrieves its index if it is found.
CodeParameterDeclarationExpression testParameter = new CodeParameterDeclarationExpression(typeof(int), "testIntArgument");
int itemIndex = -1;
if( collection.Contains( testParameter ) )
itemIndex = collection.IndexOf( testParameter );
// Copies the contents of the collection beginning at index 0 to the specified CodeParameterDeclarationExpression array.
// 'parameters' is a CodeParameterDeclarationExpression array.
collection.CopyTo( parameters, 0 );
// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;
// Inserts a CodeParameterDeclarationExpression at index 0
// of the collection.
collection.Insert( 0, new CodeParameterDeclarationExpression(typeof(int), "testIntArgument") );
// Removes the specified CodeParameterDeclarationExpression
// from the collection.
CodeParameterDeclarationExpression parameter = new CodeParameterDeclarationExpression(typeof(int), "testIntArgument");
collection.Remove( parameter );
// Removes the CodeParameterDeclarationExpression at index 0.
collection.RemoveAt(0);
' Creates an empty CodeParameterDeclarationExpressionCollection.
Dim collection As New CodeParameterDeclarationExpressionCollection()
' Adds a CodeParameterDeclarationExpression to the collection.
collection.Add(New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument"))
' Adds an array of CodeParameterDeclarationExpression objects
' to the collection.
Dim parameters As CodeParameterDeclarationExpression() = {New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument"), New CodeParameterDeclarationExpression(GetType(Boolean), "testBoolArgument")}
collection.AddRange(parameters)
' Adds a collection of CodeParameterDeclarationExpression
' objects to the collection.
Dim parametersCollection As New CodeParameterDeclarationExpressionCollection()
parametersCollection.Add(New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument"))
parametersCollection.Add(New CodeParameterDeclarationExpression(GetType(Boolean), "testBoolArgument"))
collection.AddRange(parametersCollection)
' Tests for the presence of a CodeParameterDeclarationExpression
' in the collection, and retrieves its index if it is found.
Dim testParameter As New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument")
Dim itemIndex As Integer = -1
If collection.Contains(testParameter) Then
itemIndex = collection.IndexOf(testParameter)
End If
' Copies the contents of the collection beginning at index 0 to the specified CodeParameterDeclarationExpression array.
' 'parameters' is a CodeParameterDeclarationExpression array.
collection.CopyTo(parameters, 0)
' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count
' Inserts a CodeParameterDeclarationExpression at index 0
' of the collection.
collection.Insert(0, New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument"))
' Removes the specified CodeParameterDeclarationExpression
' from the collection.
Dim parameter As New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument")
collection.Remove(parameter)
' Removes the CodeParameterDeclarationExpression at index 0.
collection.RemoveAt(0)
Kommentarer
Klassen CodeParameterDeclarationExpressionCollection innehåller ett enkelt samlingsobjekt som kan användas för att lagra en uppsättning CodeParameterDeclarationExpression objekt.
Konstruktorer
| Name | Description |
|---|---|
| CodeParameterDeclarationExpressionCollection() |
Initierar en ny instans av CodeParameterDeclarationExpressionCollection klassen. |
| CodeParameterDeclarationExpressionCollection(CodeParameterDeclarationExpression[]) |
Initierar en ny instans av CodeParameterDeclarationExpressionCollection klassen som innehåller den angivna matrisen med CodeParameterDeclarationExpression objekt. |
| CodeParameterDeclarationExpressionCollection(CodeParameterDeclarationExpressionCollection) |
Initierar en ny instans av CodeParameterDeclarationExpressionCollection klassen som innehåller elementen i den angivna källsamlingen. |
Egenskaper
| Name | Description |
|---|---|
| Capacity |
Hämtar eller anger antalet element som CollectionBase kan innehålla. (Ärvd från CollectionBase) |
| Count |
Hämtar antalet element som finns i instansen CollectionBase . Den här egenskapen kan inte åsidosättas. (Ärvd från CollectionBase) |
| InnerList |
Hämtar en ArrayList lista med element i instansen CollectionBase . (Ärvd från CollectionBase) |
| Item[Int32] |
Hämtar eller anger CodeParameterDeclarationExpression vid det angivna indexet i samlingen. |
| List |
Hämtar en IList lista med element i instansen CollectionBase . (Ärvd från CollectionBase) |
Metoder
| Name | Description |
|---|---|
| Add(CodeParameterDeclarationExpression) |
Lägger till den angivna CodeParameterDeclarationExpression i samlingen. |
| AddRange(CodeParameterDeclarationExpression[]) |
Kopierar elementen i den angivna matrisen till slutet av samlingen. |
| AddRange(CodeParameterDeclarationExpressionCollection) |
Lägger till innehållet i en annan CodeParameterDeclarationExpressionCollection i slutet av samlingen. |
| Clear() |
Tar bort alla objekt från instansen CollectionBase . Den här metoden kan inte åsidosättas. (Ärvd från CollectionBase) |
| Contains(CodeParameterDeclarationExpression) |
Hämtar ett värde som anger om samlingen innehåller den angivna CodeParameterDeclarationExpression. |
| CopyTo(CodeParameterDeclarationExpression[], Int32) |
Kopierar samlingsobjekten till en endimensionell Array instans som börjar vid det angivna indexet. |
| Equals(Object) |
Avgör om det angivna objektet är lika med det aktuella objektet. (Ärvd från Object) |
| GetEnumerator() |
Returnerar en uppräkning som itererar genom instansen CollectionBase . (Ärvd från CollectionBase) |
| GetHashCode() |
Fungerar som standard-hash-funktion. (Ärvd från Object) |
| GetType() |
Hämtar den aktuella instansen Type . (Ärvd från Object) |
| IndexOf(CodeParameterDeclarationExpression) |
Hämtar indexet i samlingen för den angivna CodeParameterDeclarationExpression, om det finns i samlingen. |
| Insert(Int32, CodeParameterDeclarationExpression) |
Infogar den angivna CodeParameterDeclarationExpression i samlingen vid det angivna indexet. |
| MemberwiseClone() |
Skapar en ytlig kopia av den aktuella Object. (Ärvd från Object) |
| OnClear() |
Utför ytterligare anpassade processer när du rensar innehållet i instansen CollectionBase . (Ärvd från CollectionBase) |
| OnClearComplete() |
Utför ytterligare anpassade processer när innehållet i instansen har rensats CollectionBase . (Ärvd från CollectionBase) |
| OnInsert(Int32, Object) |
Utför ytterligare anpassade processer innan du infogar ett nytt element i instansen CollectionBase . (Ärvd från CollectionBase) |
| OnInsertComplete(Int32, Object) |
Utför ytterligare anpassade processer när du har infogat ett nytt element i instansen CollectionBase . (Ärvd från CollectionBase) |
| OnRemove(Int32, Object) |
Utför ytterligare anpassade processer när du tar bort ett element från instansen CollectionBase . (Ärvd från CollectionBase) |
| OnRemoveComplete(Int32, Object) |
Utför ytterligare anpassade processer när du har tagit bort ett element från instansen CollectionBase . (Ärvd från CollectionBase) |
| OnSet(Int32, Object, Object) |
Utför ytterligare anpassade processer innan du anger ett värde i instansen CollectionBase . (Ärvd från CollectionBase) |
| OnSetComplete(Int32, Object, Object) |
Utför ytterligare anpassade processer när du har angett ett värde i instansen CollectionBase . (Ärvd från CollectionBase) |
| OnValidate(Object) |
Utför ytterligare anpassade processer när du verifierar ett värde. (Ärvd från CollectionBase) |
| Remove(CodeParameterDeclarationExpression) |
Tar bort den angivna CodeParameterDeclarationExpression från samlingen. |
| RemoveAt(Int32) |
Tar bort elementet vid det angivna indexet för instansen CollectionBase . Den här metoden kan inte åsidosättas. (Ärvd från CollectionBase) |
| ToString() |
Returnerar en sträng som representerar det aktuella objektet. (Ärvd från Object) |
Explicita gränssnittsimplementeringar
| Name | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Kopierar hela CollectionBase till en kompatibel endimensionell Array, med början vid det angivna indexet för målmatrisen. (Ärvd från CollectionBase) |
| ICollection.IsSynchronized |
Hämtar ett värde som anger om åtkomsten CollectionBase till är synkroniserad (trådsäker). (Ärvd från CollectionBase) |
| ICollection.SyncRoot |
Hämtar ett objekt som kan användas för att synkronisera åtkomsten CollectionBasetill . (Ärvd från CollectionBase) |
| IList.Add(Object) |
Lägger till ett objekt i slutet av CollectionBase. (Ärvd från CollectionBase) |
| IList.Contains(Object) |
Avgör om innehåller CollectionBase ett specifikt element. (Ärvd från CollectionBase) |
| IList.IndexOf(Object) |
Söker efter den angivna Object och returnerar det nollbaserade indexet för den första förekomsten i hela CollectionBase. (Ärvd från CollectionBase) |
| IList.Insert(Int32, Object) |
Infogar ett element i CollectionBase det angivna indexet. (Ärvd från CollectionBase) |
| IList.IsFixedSize |
Hämtar ett värde som anger om har CollectionBase en fast storlek. (Ärvd från CollectionBase) |
| IList.IsReadOnly |
Hämtar ett värde som anger om är CollectionBase skrivskyddat. (Ärvd från CollectionBase) |
| IList.Item[Int32] |
Hämtar eller anger elementet vid det angivna indexet. (Ärvd från CollectionBase) |
| IList.Remove(Object) |
Tar bort den första förekomsten av ett specifikt objekt från CollectionBase. (Ärvd från CollectionBase) |
Tilläggsmetoder
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
Möjliggör parallellisering av en fråga. |
| AsQueryable(IEnumerable) |
Konverterar en IEnumerable till en IQueryable. |
| Cast<TResult>(IEnumerable) |
Omvandlar elementen i en IEnumerable till den angivna typen. |
| OfType<TResult>(IEnumerable) |
Filtrerar elementen i en IEnumerable baserat på en angiven typ. |