// ------------------------------------------------------------------------------
//
//
// [....]
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ------------------------------------------------------------------------------
//
namespace System.CodeDom {
using System;
using System.Collections;
using System.Runtime.InteropServices;
///
///
/// A collection that stores objects.
///
///
[
ClassInterface(ClassInterfaceType.AutoDispatch),
ComVisible(true),
Serializable,
]
public class CodeStatementCollection : CollectionBase {
///
///
/// Initializes a new instance of .
///
///
public CodeStatementCollection() {
}
///
///
/// Initializes a new instance of based on another .
///
///
public CodeStatementCollection(CodeStatementCollection value) {
this.AddRange(value);
}
///
///
/// Initializes a new instance of containing any array of objects.
///
///
public CodeStatementCollection(CodeStatement[] value) {
this.AddRange(value);
}
///
/// Represents the entry at the specified index of the .
///
public CodeStatement this[int index] {
get {
return ((CodeStatement)(List[index]));
}
set {
List[index] = value;
}
}
///
/// Adds a with the specified value to the
/// .
///
public int Add(CodeStatement value) {
return List.Add(value);
}
///
/// [To be supplied.]
///
public int Add(CodeExpression value) {
return Add(new CodeExpressionStatement(value));
}
///
/// Copies the elements of an array to the end of the .
///
public void AddRange(CodeStatement[] value) {
if (value == null) {
throw new ArgumentNullException("value");
}
for (int i = 0; ((i) < (value.Length)); i = ((i) + (1))) {
this.Add(value[i]);
}
}
///
///
/// Adds the contents of another to the end of the collection.
///
///
public void AddRange(CodeStatementCollection value) {
if (value == null) {
throw new ArgumentNullException("value");
}
int currentCount = value.Count;
for (int i = 0; i < currentCount; i = ((i) + (1))) {
this.Add(value[i]);
}
}
///
/// Gets a value indicating whether the
/// contains the specified .
///
public bool Contains(CodeStatement value) {
return List.Contains(value);
}
///
/// Copies the values to a one-dimensional instance at the
/// specified index.
///
public void CopyTo(CodeStatement[] array, int index) {
List.CopyTo(array, index);
}
///
/// Returns the index of a in
/// the .
///
public int IndexOf(CodeStatement value) {
return List.IndexOf(value);
}
///
/// Inserts a into the at the specified index.
///
public void Insert(int index, CodeStatement value) {
List.Insert(index, value);
}
///
/// Removes a specific from the
/// .
///
public void Remove(CodeStatement value) {
List.Remove(value);
}
}
}