Class ReadOnlyStringList
A read-only collection of string with case insensitive comparisons. The items are stored as upper invariant case.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 7.19.2Syntax
public class ReadOnlyStringList : IList<string>, ICollection<string>, IEnumerable<string>, IEnumerableConstructors
ReadOnlyStringList(IList<String>)
Initializes a new instance of the ReadOnlyStringList class.
Declaration
public ReadOnlyStringList(IList<string> items)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Collections.Generic.IList<System.String> | items | The items. | 
Properties
Count
Gets the number of elements contained in the System.Collections.Generic.ICollection<T>.
Declaration
public int Count { get; }Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
IsReadOnly
Gets a value indicating whether the System.Collections.Generic.ICollection<T> is read-only.
Declaration
public bool IsReadOnly { get; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
Item[Int32]
Gets or the System.String at the specified index. Set is not a valid operation on a readonly list. Will throw InvalidOperationException;
Declaration
public string this[int index] { get; set; }Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | index | 
Property Value
| Type | Description | 
|---|---|
| System.String | 
Methods
Add(String)
Not a valid operation on a readonly list. Will throw InvalidOperationException;
Declaration
public void Add(string item)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | item | The object to add to the System.Collections.Generic.ICollection<T>. | 
Exceptions
| Type | Condition | 
|---|---|
| System.NotSupportedException | The System.Collections.Generic.ICollection<T> is read-only. | 
Clear()
Not a valid operation on a readonly list. Will throw InvalidOperationException;
Declaration
public void Clear()Exceptions
| Type | Condition | 
|---|---|
| System.NotSupportedException | The System.Collections.Generic.ICollection<T> is read-only. | 
Contains(String)
Determines whether the System.Collections.Generic.ICollection<T> contains a specific value. The compairson will be performed on upper invariant case.
Declaration
public bool Contains(string item)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | item | The object to locate in the System.Collections.Generic.ICollection<T>. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | true if  | 
CopyTo(String[], Int32)
Copies the elements of the System.Collections.Generic.ICollection<T> to an System.Array, starting at a particular System.Array index.
Declaration
public void CopyTo(string[] array, int arrayIndex)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String[] | array | The one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.ICollection<T>. The System.Array must have zero-based indexing. | 
| System.Int32 | arrayIndex | The zero-based index in  | 
Exceptions
| Type | Condition | 
|---|---|
| System.ArgumentNullException | 
 | 
| System.ArgumentOutOfRangeException | 
 | 
| System.ArgumentException | 
 | 
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<string> GetEnumerator()Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerator<System.String> | A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection. | 
IndexOf(String)
Determines the index of a specific item in the System.Collections.Generic.IList<T>.
Declaration
public int IndexOf(string item)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | item | The object to locate in the System.Collections.Generic.IList<T>. | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | The index of  | 
Insert(Int32, String)
Not a valid operation on a readonly list. Will throw InvalidOperationException;
Declaration
public void Insert(int index, string item)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | index | The zero-based index at which  | 
| System.String | item | The object to insert into the System.Collections.Generic.IList<T>. | 
Exceptions
| Type | Condition | 
|---|---|
| System.ArgumentOutOfRangeException | 
 | 
| System.NotSupportedException | The System.Collections.Generic.IList<T> is read-only. | 
Remove(String)
Not a valid operation on a readonly list. Will throw InvalidOperationException;
Declaration
public bool Remove(string item)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | item | The object to remove from the System.Collections.Generic.ICollection<T>. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | true if  | 
Exceptions
| Type | Condition | 
|---|---|
| System.NotSupportedException | The System.Collections.Generic.ICollection<T> is read-only. | 
RemoveAt(Int32)
Not a valid operation on a readonly list. Will throw InvalidOperationException;
Declaration
public void RemoveAt(int index)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | index | The zero-based index of the item to remove. | 
Exceptions
| Type | Condition | 
|---|---|
| System.ArgumentOutOfRangeException | 
 | 
| System.NotSupportedException | The System.Collections.Generic.IList<T> is read-only. | 
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()Returns
| Type | Description | 
|---|---|
| System.Collections.IEnumerator | An System.Collections.IEnumerator object that can be used to iterate through the collection. | 
