Search Results for

    Show / Hide Table of Contents

    Class StatefulCollection<T>

    Collection which handles internal a list of: new, not changed and deleted items.

    Inheritance
    System.Object
    StatefulCollection<T>
    Implements
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Simplic.Collections.Generic
    Assembly: Simplic.CoreLib.dll
    Syntax
    public class StatefulCollection<T> : ICollection<T>, IEnumerable<T>, IEnumerable
    Type Parameters
    Name Description
    T

    Item type

    Constructors

    | Improve this Doc View Source

    StatefulCollection(IEnumerable<T>)

    Initialize new stateful iterable

    Declaration
    public StatefulCollection(IEnumerable<T> initialList)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> initialList

    Initial list of items

    Properties

    | Improve this Doc View Source

    Count

    Gets the amount of items (new and current items)

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    CountNewItems

    Get the amount of new items

    Declaration
    public int CountNewItems { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    CountRemovedItems

    Gets the amount of removed items

    Declaration
    public int CountRemovedItems { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    IsReadOnly

    Gets whether the current collection is readonly or not

    Declaration
    public bool IsReadOnly { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    Add(T)

    Add a new item. If the item already exists - ignore it If the item was removed, put it in the item list again

    Declaration
    public void Add(T item)
    Parameters
    Type Name Description
    T item

    Item to add

    | Improve this Doc View Source

    AddRange(IEnumerable<T>)

    Add a range of items. Each item will be handled as described for Add(T)

    Declaration
    public void AddRange(IEnumerable<T> collection)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> collection
    | Improve this Doc View Source

    Clear()

    Clear the howle collection

    Declaration
    public void Clear()
    | Improve this Doc View Source

    Commit()

    Cleares the to remove list and add all items from new item to items

    Declaration
    public void Commit()
    | Improve this Doc View Source

    Contains(T)

    Check whether an items exists in the items list or the new items list

    Declaration
    public bool Contains(T item)
    Parameters
    Type Name Description
    T item

    Item to proof

    Returns
    Type Description
    System.Boolean

    True if the item exists

    | Improve this Doc View Source

    CopyTo(T[], Int32)

    Copy current items into an array

    Declaration
    public void CopyTo(T[] array, int arrayIndex)
    Parameters
    Type Name Description
    T[] array

    Array to copy items to

    System.Int32 arrayIndex

    Start index

    | Improve this Doc View Source

    GetAsObservableCollection()

    Shows a preview of the commited collection data

    Declaration
    public ObservableCollection<T> GetAsObservableCollection()
    Returns
    Type Description
    System.Collections.ObjectModel.ObservableCollection<T>

    data after a possible commit

    | Improve this Doc View Source

    GetEnumerator()

    Get enumerator for the list of items and new items

    Declaration
    public IEnumerator<T> GetEnumerator()
    Returns
    Type Description
    System.Collections.Generic.IEnumerator<T>

    Returns an instance of an enumerator

    | Improve this Doc View Source

    GetItems()

    Enumerator to all comitted items

    Declaration
    public IEnumerable<T> GetItems()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T>

    Enumerable of comitted items

    | Improve this Doc View Source

    GetNewItems()

    Enumerator to iteratore over all new items

    Declaration
    public IEnumerable<T> GetNewItems()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T>

    Enumerable of new items

    | Improve this Doc View Source

    GetRemovedItems()

    Enumerator to iteratore over all removed items

    Declaration
    public IEnumerable<T> GetRemovedItems()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T>

    Enumerable of removed items

    | Improve this Doc View Source

    MarkAllAsRemoved()

    Mark all items in the items list as removed and put them in the removed list

    Declaration
    public void MarkAllAsRemoved()
    | Improve this Doc View Source

    Remove(T)

    Remove an item and put it into the removed items list

    Declaration
    public bool Remove(T item)
    Parameters
    Type Name Description
    T item

    Item to remove

    Returns
    Type Description
    System.Boolean

    True if the item was removed, false if not

    Events

    | Improve this Doc View Source

    AddItem

    On add item event

    Declaration
    public event StatefulCollection<T>.AddItemEventHandler AddItem
    Event Type
    Type Description
    StatefulCollection.AddItemEventHandler<>
    | Improve this Doc View Source

    ClearCollection

    On clear collection event

    Declaration
    public event StatefulCollection<T>.ClearCollectionEventHandlder ClearCollection
    Event Type
    Type Description
    StatefulCollection.ClearCollectionEventHandlder<>
    | Improve this Doc View Source

    CollectionCleared

    On item cleared event

    Declaration
    public event StatefulCollection<T>.CollectionClearedEventHandlder CollectionCleared
    Event Type
    Type Description
    StatefulCollection.CollectionClearedEventHandlder<>
    | Improve this Doc View Source

    CollectionCommitted

    On collection committed event

    Declaration
    public event StatefulCollection<T>.CollectionCommittedEventHandlder CollectionCommitted
    Event Type
    Type Description
    StatefulCollection.CollectionCommittedEventHandlder<>
    | Improve this Doc View Source

    CommitCollection

    On commit collection event

    Declaration
    public event StatefulCollection<T>.CommitCollectionEventHandlder CommitCollection
    Event Type
    Type Description
    StatefulCollection.CommitCollectionEventHandlder<>
    | Improve this Doc View Source

    ItemAdded

    On item added event

    Declaration
    public event StatefulCollection<T>.ItemAddedEventHandler ItemAdded
    Event Type
    Type Description
    StatefulCollection.ItemAddedEventHandler<>
    | Improve this Doc View Source

    ItemRemoved

    On item removed event

    Declaration
    public event StatefulCollection<T>.ItemRemovedEventHandler ItemRemoved
    Event Type
    Type Description
    StatefulCollection.ItemRemovedEventHandler<>
    | Improve this Doc View Source

    RemoveItem

    On remove item event

    Declaration
    public event StatefulCollection<T>.RemoveItemEventHandler RemoveItem
    Event Type
    Type Description
    StatefulCollection.RemoveItemEventHandler<>

    Explicit Interface Implementations

    | Improve this Doc View Source

    IEnumerable.GetEnumerator()

    Get the enumerator to iterate over the current collection content without removed items

    Declaration
    IEnumerator IEnumerable.GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

    Enumerator

    Implements

    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable

    Extension Methods

    NumericExtension.Sum<T>(IEnumerable<T>, Func<T, Numeric>)
    PreciseDecimalExtension.Sum<T>(IEnumerable<T>, Func<T, PreciseDecimal>)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 SIMPLIC GmbH
    Generated by DocFx