[]
        
(Showing Draft Content)

GrapeCity.Documents.Common.ReadOnlyStructList-1

Class ReadOnlyStructList<T>

Namespace
GrapeCity.Documents.Common
Assembly
GcDocs.Imaging.dll

Represents a strongly typed read-only list of structs that can be effectively accessed by index.

public class ReadOnlyStructList<T> where T : struct

Type Parameters

T

The type of structs in the list.

Inheritance
object
ReadOnlyStructList<T>
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

ReadOnlyStructList(StructList<T>)

Initializes a new instance of the ReadOnlyStructList<T> class from a given instance of StructList<T>.

public ReadOnlyStructList(StructList<T> list)

Parameters

list StructList<T>

Properties

Count

Gets the number of elements actually contained in the ReadOnlyStructList<T>.

public int Count { get; }

Property Value

int

this[int]

Gets a reference to the struct at the specified index.

public ref T this[int index] { get; }

Parameters

index int

Property Value

T

SyncRoot

Gets an object that can be used to synchronize access to the ReadOnlyStructList<T>.

public object SyncRoot { get; }

Property Value

object

Methods

BinarySearch(int, int, in T, IStructComparer<T>)

Searches a range of elements in the sorted ReadOnlyStructList<T> for an element using the specified comparer and returns the zero-based index of the element.

public int BinarySearch(int index, int count, in T item, IStructComparer<T> comparer)

Parameters

index int

The zero-based starting index of the range to search.

count int

The length of the range to search.

item T

The object to locate.

comparer IStructComparer<T>

The IStructComparer<T> implementation to use when comparing elements.

Returns

int

The zero-based index of item in the sorted ReadOnlyStructList<T>, if item is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element, the bitwise complement of Count.

BinarySearch(int, int, in T, StructComparison<T>)

Searches a range of elements in the sorted ReadOnlyStructList<T> for an element using the specified StructComparison<T> and returns the zero-based index of the element.

public int BinarySearch(int index, int count, in T item, StructComparison<T> comparison)

Parameters

index int

The zero-based starting index of the range to search.

count int

The length of the range to search.

item T

The object to locate.

comparison StructComparison<T>

The StructComparison<T> to use when comparing elements.

Returns

int

The zero-based index of item in the sorted ReadOnlyStructList<T>, if item is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element, the bitwise complement of Count.

ConvertAll<TOutput>(StructConverter<T, TOutput>)

Converts the elements in the current ReadOnlyStructList<T> to another type, and returns a list containing the converted elements.

public StructList<TOutput> ConvertAll<TOutput>(StructConverter<T, TOutput> converter) where TOutput : struct

Parameters

converter StructConverter<T, TOutput>

A StructConverter<TInput, TOutput> delegate that converts each element from one type to another type.

Returns

StructList<TOutput>

A StructList<T> of the target type containing the converted elements from the current ReadOnlyStructList<T>.

Type Parameters

TOutput

The type of the elements of the target array.

CopyTo(T[], int)

Copies the entire ReadOnlyStructList<T> to a compatible one-dimensional array, starting at the specified index of the target array.

public void CopyTo(T[] array, int arrayIndex)

Parameters

array T[]

The one-dimensional System.Array that is the destination of the elements copied from ReadOnlyStructList<T>.

arrayIndex int

The zero-based index in array at which copying begins.

CopyTo(int, T[], int, int)

Copies a range of elements from the ReadOnlyStructList<T> to a compatible one-dimensional array, starting at the specified index of the target array.

public void CopyTo(int index, T[] array, int arrayIndex, int count)

Parameters

index int

The zero-based index in the source ReadOnlyStructList<T> at which copying begins.

array T[]

The one-dimensional System.Array that is the destination of the elements copied from ReadOnlyStructList<T>.

arrayIndex int

The zero-based index in array at which copying begins.

count int

The number of elements to copy.

CountAll(StructPredicate<T>)

Gets the number of elements in the ReadOnlyStructList<T> that match the conditions defined by the specified predicate.

public int CountAll(StructPredicate<T> match)

Parameters

match StructPredicate<T>

The StructPredicate<T> delegate that defines the conditions of the elements to match.

Returns

int

The number of elements that match the conditions defined by the predicate.

Exists(StructPredicate<T>)

Determines whether the ReadOnlyStructList<T> contains elements that match the conditions defined by the specified predicate.

public bool Exists(StructPredicate<T> match)

Parameters

match StructPredicate<T>

The StructPredicate<T> delegate that defines the conditions of the elements to search for.

Returns

bool

true if the ReadOnlyStructList<T> contains one or more elements that match the conditions defined by the specified predicate; otherwise, false.

FindAll(StructPredicate<T>)

Retrieves all the elements that match the conditions defined by the specified predicate.

public StructList<T> FindAll(StructPredicate<T> match)

Parameters

match StructPredicate<T>

The StructPredicate<T> delegate that defines the conditions of the elements to search for.

Returns

StructList<T>

A StructList<T> containing all the elements that match the conditions defined by the specified predicate, if found; otherwise, an empty StructList<T>.

FindIndex(StructPredicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire ReadOnlyStructList<T>.

public int FindIndex(StructPredicate<T> match)

Parameters

match StructPredicate<T>

The StructPredicate<T> delegate that defines the conditions of the element to search for.

Returns

int

The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1.

FindIndex(int, StructPredicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the ReadOnlyStructList<T> that extends from the specified index to the last element.

public int FindIndex(int startIndex, StructPredicate<T> match)

Parameters

startIndex int

The zero-based starting index of the search.

match StructPredicate<T>

The StructPredicate<T> delegate that defines the conditions of the element to search for.

Returns

int

The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1.

FindIndex(int, int, StructPredicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the ReadOnlyStructList<T> that starts at the specified index and contains the specified number of elements.

public int FindIndex(int startIndex, int count, StructPredicate<T> match)

Parameters

startIndex int

The zero-based starting index of the search.

count int

The number of elements in the section to search.

match StructPredicate<T>

The StructPredicate<T> delegate that defines the conditions of the element to search for.

Returns

int

The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1.

FindLastIndex(StructPredicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire ReadOnlyStructList<T>.

public int FindLastIndex(StructPredicate<T> match)

Parameters

match StructPredicate<T>

The StructPredicate<T> delegate that defines the conditions of the element to search for.

Returns

int

The zero-based index of the last occurrence of an element that matches the conditions defined by match, if found; otherwise, –1.

FindLastIndex(int, StructPredicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the ReadOnlyStructList<T> that extends from the first element to the specified index.

public int FindLastIndex(int startIndex, StructPredicate<T> match)

Parameters

startIndex int

The zero-based starting index of the backward search.

match StructPredicate<T>

The StructPredicate<T> delegate that defines the conditions of the element to search for.

Returns

int

The zero-based index of the last occurrence of an element that matches the conditions defined by match, if found; otherwise, –1.

FindLastIndex(int, int, StructPredicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the ReadOnlyStructList<T> that contains the specified number of elements and ends at the specified index.

public int FindLastIndex(int startIndex, int count, StructPredicate<T> match)

Parameters

startIndex int

The zero-based starting index of the backward search.

count int

The number of elements in the section to search.

match StructPredicate<T>

The StructPredicate<T> delegate that defines the conditions of the element to search for.

Returns

int

The zero-based index of the last occurrence of an element that matches the conditions defined by match, if found; otherwise, –1.

ForEach(StructAction<T>)

Performs the specified action on each element of the ReadOnlyStructList<T>.

public void ForEach(StructAction<T> action)

Parameters

action StructAction<T>

The StructAction<T> delegate to perform on each element of the ReadOnlyStructList<T>.

GetRange(int, int)

Creates a shallow copy of a range of elements in the source ReadOnlyStructList<T>.

public StructList<T> GetRange(int index, int count)

Parameters

index int

The zero-based ReadOnlyStructList<T> index at which the range starts.

count int

The number of elements in the range.

Returns

StructList<T>

A shallow copy of a range of elements in the source ReadOnlyStructList<T>.

ToArray()

Copies the elements of the ReadOnlyStructList<T> to a new array.

public T[] ToArray()

Returns

T[]

An array containing copies of the elements of the ReadOnlyStructList<T>.

TrueForAll(StructPredicate<T>)

Determines whether every element in the ReadOnlyStructList<T> matches the conditions defined by the specified predicate.

public bool TrueForAll(StructPredicate<T> match)

Parameters

match StructPredicate<T>

The StructPredicate<T> delegate that defines the conditions to check against the elements.

Returns

bool

true if every element in the ReadOnlyStructList<T> matches the conditions defined by the specified predicate; otherwise, false. If the list has no elements, the return value is true.