mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 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.ICollection System.ICloneable System.Diagnostics.DebuggerDisplay("Count={Count}") System.Diagnostics.DebuggerTypeProxy(typeof(System.Collections.CollectionDebuggerView)) System.Runtime.InteropServices.ComVisible(true)

Queues are useful for storing messages in the order they were received for sequential processing. This class implements a queue as a circular array. Objects stored in a are inserted at one end and removed from the other.

The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling .

The growth factor is the number by which the current capacity is multiplied when a greater capacity is required. The growth factor is determined when the is constructed. The default growth factor is 2.0. The capacity of the will always increase by at least a minimum of four, regardless of the growth factor. For example, a with a growth factor of 1.0 will always increase in capacity by four when a greater capacity is required.

accepts null as a valid value and allows duplicate elements.

For the generic version of this collection, see

Represents a first-in, first-out collection of objects.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling .

  The growth factor is the number by which the current capacity is multiplied when a greater capacity is required. The growth factor is determined when the is constructed.

  This constructor is an O(1) operation.

  Initializes a new instance of the class that is empty, has the default initial capacity, and uses the default growth factor.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling .

  The growth factor is the number by which the current capacity is multiplied when a greater capacity is required. The growth factor is determined when the is constructed.

  The elements are copied onto the in the same order they are read by the of the .

  This constructor is an O() operation, where is the number of elements in .

  Initializes a new instance of the class that contains elements copied from the specified collection, has the same initial capacity as the number of elements copied, and uses the default growth factor.

  The to copy elements from.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling .

  The growth factor is the number by which the current capacity is multiplied when a greater capacity is required. The growth factor is determined when the is constructed.

  If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the .

  This constructor is an O() operation, where is .

  Initializes a new instance of the class that is empty, has the specified initial capacity, and uses the default growth factor.

  The initial number of elements that the can contain.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling .

  The growth factor is the number by which the current capacity is multiplied when a greater capacity is required. The growth factor is determined when the is constructed. The capacity of the will always increase by a minimum value, regardless of the growth factor; a growth factor of 1.0 will not prevent the from increasing in size.

  If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the .

  This constructor is an O() operation, where is .

  Initializes a new instance of the class that is empty, has the specified initial capacity, and uses the specified growth factor.

  The initial number of elements that the can contain.
  The factor by which the capacity of the is expanded.
- 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.

  The capacity remains unchanged. To reset the capacity of the , call . Trimming an empty sets the capacity of the to the default capacity.

  This method is an O() operation, where is .

  Removes all objects from the .

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object

  A shallow copy of a collection copies only the elements of the collection, whether they are reference types or value types, but it does not copy the objects that the references refer to. The references in the new collection point to the same objects that the references in the original collection point to.

  In contrast, a deep copy of a collection copies the elements and everything directly or indirectly referenced by the elements.

  This method is an O() operation, where is .

  Creates a shallow copy of the .

  A shallow copy of the .

- 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 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.Void `` ``

  The elements are copied to the in the same order in which the enumerator iterates through the .

  This method is an O() operation, where is .

  Copies the elements to an existing one-dimensional , starting at the specified array index.

  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.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 To be added: an object of type 'int'

  The capacity of a is the number of elements that the can store. is the number of elements that are actually in the .

  The capacity of a is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. The new capacity is determined by multiplying the current capacity by the growth factor, which is determined when the is constructed. The capacity of the will always increase by a minimum value, regardless of the growth factor; a growth factor of 1.0 will not prevent the from increasing in size.

  The capacity can be decreased by calling .

  Retrieving the value of this property is an O(1) operation.

  Gets the number of elements contained in the .

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object

  This method is similar to the method, but does not modify the .

  null can be added to the as a value. To distinguish between a null value and the end of the , check the property or catch the , which is thrown when the is empty.

  This method is an O(1) operation.

  Removes and returns the object at the beginning of the .

  The object that is removed from the beginning of the .

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling .

  The growth factor is the number by which the current capacity is multiplied when a greater capacity is required. The growth factor is determined when the is constructed. The capacity of the will always increase by a minimum value, regardless of the growth factor; a growth factor of 1.0 will not prevent the from increasing in size.

  If is less than the capacity of the internal array, this method is an O(1) operation. If the internal array needs to be reallocated to accommodate the new element, this method becomes an O() operation, where is .

  Adds an object to the end of the .

  The object to add to the . The value can be null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Collections.IEnumerator

  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 an enumerator that iterates through the .

  An for the .

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added: an object of type 'bool'

  To guarantee the thread safety of the , all operations must be done through the wrapper returned by the method.

  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.

  Gets a value indicating whether access to the is synchronized (thread safe).

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object

  This method is similar to the method, but does not modify the .

  null can be added to the as a value. To distinguish between a null value and the end of the , check the property or catch the , which is thrown when the is empty.

  This method is an O(1) operation.

  Returns the object at the beginning of the without removing it.

  The object at the beginning of the .

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Collections.Queue ``

  To guarantee the thread safety of the , all operations must be done through this wrapper only.

  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.

  Returns a wrapper that is synchronized (thread safe).

  A wrapper that is synchronized (thread safe).

  The to synchronize.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object To be added: an object of type 'object'

  To create a synchronized version of the , use the method. However, 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.

  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.Object[]

  The is not modified. The order of the elements in the new array is the same as the order of the elements from the beginning of the to its end.

  This method is an O() operation, where is .

  Copies the elements to a new array.

  A new array containing elements copied from the .

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  This method can be used to minimize a queue's memory overhead if no new elements will be added to the queue.

  To reset a to its initial state, call the method before calling . Trimming an empty sets the capacity of the to the default capacity.

  This method is an O() operation, where is .

  Sets the capacity to the actual number of elements in the .