System
[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]
1.0.3300.0
1.0.5000.0
2.0.0.0
4.0.0.0
Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.
System.Object
System.Collections.IList
accepts null as a valid value and allows duplicate elements.
String comparisons are case-sensitive.
Elements in this collection can be accessed using an integer index. Indexes in this collection are zero-based.
Represents a collection of strings.
Constructor
1.0.5000.0
2.0.0.0
4.0.0.0
This constructor is an O(1) operation.
Initializes a new instance of the class.
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Int32
accepts null as a valid value and allows duplicate elements.
If is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O() operation, where is .
Adds a string to the end of the .
The zero-based index at which the new element is inserted.
The string to add to the end of the . The value can be null.
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Void
accepts null as a valid value and allows duplicate elements.
If the can accommodate the new elements without increasing the capacity, this method is an O() operation, where is the number of elements to be added. If the capacity needs to be increased to accommodate the new elements, this method becomes an O( + ) operation, where is the number of elements to be added and is .
Copies the elements of a string array to the end of the .
An array of strings to add to the end of the . The array itself can not be null but it can contain elements that are null.
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Void
is set to zero, and references to other objects from elements of the collection are also released.
This method is an O() operation, where is .
Removes all the strings from the .
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Boolean
The method can confirm the existence of a string before performing further operations.
This method determines equality by calling . String comparisons are case-sensitive.
This method performs a linear search; therefore, this method is an O() operation, where is .
Starting with the .NET Framework 2.0, this method uses the collection’s objects’ and methods on to determine whether item exists. In the earlier versions of the .NET Framework, this determination was made by using the and methods of the parameter on the objects in the collection.
Determines whether the specified string is in the .
true if is found in the ; otherwise, false.
The string to locate in the . The value can be null.
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Void
The specified array must be of a compatible type.
The elements are copied to the in the same order in which the enumerator of the iterates through the .
This method is an O() operation, where is .
Copies the entire values to a one-dimensional array of strings, starting at the specified index of the target array.
The one-dimensional array of strings that is the destination of the elements copied from . The must have zero-based indexing.
The zero-based index in at which copying begins.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Int32
To be added: an object of type 'int'
Retrieving the value of this property is an O(1) operation.
Gets the number of strings contained in the .
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Collections.Specialized.StringEnumerator
[Visual Basic, C#]
The foreach statement of the C# language (for each in Visual Basic) hides the complexity of the enumerators. Therefore, using foreach is recommended, instead of directly manipulating the enumerator.
Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.
Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of .
returns the same object until either or is called. sets to the next element.
If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns false. When the enumerator is at this position, subsequent calls to also return false. If the last call to returned false, is undefined. To set to the first element of the collection again, you can call followed by .
An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.
The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.
This method is an O(1) operation.
Returns a that iterates through the .
A for the .
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Int32
This method determines equality by calling . String comparisons are case-sensitive.
This method performs a linear search; therefore, this method is an O() operation, where is .
Starting with the .NET Framework 2.0, this method uses the collection’s objects’ and methods on to determine whether item exists. In the earlier versions of the .NET Framework, this determination was made by using the and methods of the parameter on the objects in the collection.
Searches for the specified string and returns the zero-based index of the first occurrence within the .
The zero-based index of the first occurrence of in the , if found; otherwise, -1.
The string to locate. The value can be null.
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Void
Duplicate strings are allowed in .
If is equal to , is added to the end of .
In collections of contiguous elements, such as lists, the elements that follow the insertion point move down to accommodate the new element. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table.
This method is an O() operation, where is .
Inserts a string into the at the specified index.
The zero-based index at which is inserted.
The string to insert. The value can be null.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Boolean
To be added: an object of type 'bool'
implements the property because it is required by the interface.
A collection that is read-only does not allow the addition, removal, or modification of elements after the collection is created.
A collection that is read-only is simply a collection with a wrapper that prevents modifying the collection; therefore, if changes are made to the underlying collection, the read-only collection reflects those changes.
A instance is always writable.
Retrieving the value of this property is an O(1) operation.
Gets a value indicating whether the is read-only.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Boolean
To be added: an object of type 'bool'
implements the property because it is required by the interface.
Enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.
The following code example shows how to lock the collection using the during the entire enumeration:
code reference: System.Collections.Specialized.StringCollection2#2
Retrieving the value of this property is an O(1) operation.
Gets a value indicating whether access to the is synchronized (thread safe).
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.String
To be added: an object of type 'int'
To be added
To be added: an object of type 'string'
To be added
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Void
Duplicate strings are allowed in . Only the first occurrence is removed. To remove all occurrences of the specified string, use RemoveAt(IndexOf(value)) repeatedly while does not return -1.
If the does not contain the specified object, the remains unchanged. No exception is thrown.
In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table.
This method determines equality by calling . String comparisons are case-sensitive.
This method performs a linear search; therefore, this method is an O() operation, where is .
Removes the first occurrence of a specific string from the .
The string to remove from the . The value can be null.
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Void
In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table.
This method is an O() operation, where is .
Removes the string at the specified index of the .
The zero-based index of the string to remove.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Object
To be added: an object of type 'object'
Derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object.
Enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.
The following code example shows how to lock the collection using the during the entire enumeration:
code reference: System.Collections.Specialized.StringCollection2#2
Retrieving the value of this property is an O(1) operation.
Gets an object that can be used to synchronize access to the .
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Void
The specified array must be of a compatible type.
This method uses to copy the elements.
This method is an O() operation, where is .
Copies the entire to a compatible one-dimensional , starting at the specified index of the target array.
The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing.
The zero-based index in at which copying begins.
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Collections.IEnumerator
[Visual Basic, C#]
The foreach statement of the C# language (for each in Visual Basic) hides the complexity of the enumerators. Therefore, using foreach is recommended, instead of directly manipulating the enumerator.
Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.
Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of .
returns the same object until either or is called. sets to the next element.
If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns false. When the enumerator is at this position, subsequent calls to also return false. If the last call to returned false, calling throws an exception. To set to the first element of the collection again, you can call followed by .
An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated.
The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.
This method is an O(1) operation.
Returns a that iterates through the .
A for the .
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Int32
accepts null as a valid value and allows duplicate elements.
If already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added.
If is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O() operation, where is .
Adds an object to the end of the .
The index at which the has been added.
The to be added to the end of the . The value can be null.
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Boolean
This method determines equality by calling .
This method performs a linear search; therefore, this method is an O() operation, where is .
Starting with the .NET Framework 2.0, this method uses the collection’s objects’ and methods on to determine whether item exists. In the earlier versions of the .NET Framework, this determination was made by using the and methods of the parameter on the objects in the collection.
Determines whether an element is in the .
true if is found in the ; otherwise, false.
The to locate in the . The value can be null.
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Int32
The is searched forward starting at the first element and ending at the last element.
This method determines equality by calling .
This method performs a linear search; therefore, this method is an O() operation, where is .
Starting with the .NET Framework 2.0, this method uses the collection’s objects’ and methods on to determine whether item exists. In the earlier versions of the .NET Framework, this determination was made by using the and methods of the parameter on the objects in the collection.
Searches for the specified and returns the zero-based index of the first occurrence within the entire .
The zero-based index of the first occurrence of within the entire , if found; otherwise, -1.
The to locate in the . The value can be null.
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Void
If already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added.
If is equal to , is added to the end of .
In collections of contiguous elements, such as lists, the elements that follow the insertion point move down to accommodate the new element. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table.
This method is an O() operation, where is .
Inserts an element into the at the specified index.
The zero-based index at which should be inserted.
The to insert. The value can be null.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Boolean
To be added.
A collection with a fixed size does not allow the addition or removal of elements after the collection is created, but does allow the modification of existing elements.
A collection with a fixed size is simply a collection with a wrapper that prevents adding and removing elements; therefore, if changes are made to the underlying collection, including the addition or removal of elements, the fixed-size collection reflects those changes.
Retrieving the value of this property is an O(1) operation.
Gets a value indicating whether the object has a fixed size.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Boolean
To be added.
A collection that is read-only does not allow the addition, removal, or modification of elements after the collection is created.
A collection that is read-only is simply a collection with a wrapper that prevents modifying the collection; therefore, if changes are made to the underlying collection, the read-only collection reflects those changes.
Retrieving the value of this property is an O(1) operation.
Gets a value indicating whether the object is read-only.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Object
To be added.
To be added.
To be added.
To be added.
Method
1.0.5000.0
2.0.0.0
4.0.0.0
System.Void
If the does not contain the specified object, the remains unchanged. No exception is thrown.
In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table.
This method determines equality by calling .
This method performs a linear search; therefore, this method is an O() operation, where is .
Removes the first occurrence of a specific object from the .
The to remove from the . The value can be null.