Table of Contents

Class PollPeriodsCollection

Namespace
Lers.Data.PollState
Assembly
Lers.System.dll

Хранит список периодов и предоставляет некоторые функции.

public class PollPeriodsCollection : ICollection<PollPeriod>, IEnumerable<PollPeriod>, IEnumerable
Inheritance
PollPeriodsCollection
Implements
Inherited Members
Extension Methods

Constructors

PollPeriodsCollection(DataStatusPeriod[], PollState)

Конструктор PollPeriodsCollection.

public PollPeriodsCollection(DataStatusPeriod[] periods, PollState pollState)

Parameters

periods DataStatusPeriod[]
pollState PollState

Экземпляр класса PollState, к которому относятся периоды.

Properties

Count

Gets the number of elements contained in the ICollection<T>.

public int Count { get; }

Property Value

int

The number of elements contained in the ICollection<T>.

IsReadOnly

Gets a value indicating whether the ICollection<T> is read-only.

public bool IsReadOnly { get; }

Property Value

bool

true if the ICollection<T> is read-only; otherwise, false.

this[int]

Возвращает период по заданному индексу.

public PollPeriod this[int index] { get; }

Parameters

index int

Property Value

PollPeriod

Methods

Add(PollPeriod)

Добавляет период в коллекцию.

public void Add(PollPeriod value)

Parameters

value PollPeriod

Экземпляр класса PollPeriod.

Clear()

Removes all items from the ICollection<T>.

public void Clear()

Exceptions

NotSupportedException

The ICollection<T> is read-only.

Contains(PollPeriod)

Determines whether the ICollection<T> contains a specific value.

public bool Contains(PollPeriod item)

Parameters

item PollPeriod

The object to locate in the ICollection<T>.

Returns

bool

true if item is found in the ICollection<T>; otherwise, false.

CopyTo(PollPeriod[], int)

Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.

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

Parameters

array PollPeriod[]

The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.

arrayIndex int

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

Exceptions

ArgumentNullException

array is null.

ArgumentOutOfRangeException

arrayIndex is less than 0.

ArgumentException

The number of elements in the source ICollection<T> is greater than the available space from arrayIndex to the end of the destination array.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<PollPeriod> GetEnumerator()

Returns

IEnumerator<PollPeriod>

An enumerator that can be used to iterate through the collection.

GetPeriod(int)

Определяет период, которому принадлежит указанная метка времени.

public PollPeriod GetPeriod(int timeMark)

Parameters

timeMark int

Метка времени.

Returns

PollPeriod

Возвращает период PollPeriod, или null если метка не принадлежит ни одному периоду.

GetPeriodLength(int, out DateTime?, out DateTime?)

Определяет длину периода, которому принадлежит указанная метка времени даже если данного периода не существует (белая полоса).

public int GetPeriodLength(int timeMark, out DateTime? startDate, out DateTime? endDate)

Parameters

timeMark int

Метка времени.

startDate DateTime?

Дата начала периода.

endDate DateTime?

Дата окончания периода.

Returns

int

Возвращает длину периода.

GetSummaryLength(DataStatus)

Определяет суммарную длину перодов с указанным статусом данных.

public int GetSummaryLength(DataStatus dataStatus)

Parameters

dataStatus DataStatus

Статус данных.

Returns

int

Возвращает длину периодов.

IndexOf(PollPeriod)

Возвращает индекс периода в коллекции периодов.

public int IndexOf(PollPeriod value)

Parameters

value PollPeriod

Returns

int

Remove(PollPeriod)

Removes the first occurrence of a specific object from the ICollection<T>.

public bool Remove(PollPeriod item)

Parameters

item PollPeriod

The object to remove from the ICollection<T>.

Returns

bool

true if item was successfully removed from the ICollection<T>; otherwise, false. This method also returns false if item is not found in the original ICollection<T>.

Exceptions

NotSupportedException

The ICollection<T> is read-only.