Exemplo n.º 1
0
        public static async Task <MyReversedObservableCollection <TItem> > CreateInstance(
            IMyNotifyCollectionChanged <TItem> collection
            )
        {
            Assert.NotNull(collection);
            var result = new MyReversedObservableCollection <TItem>();

            result._originCollection = collection;
            result._stateHelper.SetInitializedState();
            result._subscriptions.Add(
                collection.CollectionChangedObservable.Subscribe(
                    _ =>
            {
                if (result._changedArgsDict.TryAdd(_.ChangesNum, _))
                {
                    result.ProcessNewChangedArgs();
                }
            }
                    )
                );
            using (await result._lockSem.GetDisposable().ConfigureAwait(false))
            {
                await result.ResetActionAsync().ConfigureAwait(false);
            }
            result.ProcessNewChangedArgs();
            return(result);
        }
 public static async Task <MyFilteredObservableCollectionImpl <TItem> > CreateInstance <TItem>(
     IMyNotifyCollectionChanged <TItem> collection,
     IObservableCollectionProxyFilter <TItem> filter
     )
 {
     return(await MyFilteredObservableCollectionImpl <TItem> .CreateInstance(
                collection,
                filter
                ).ConfigureAwait(false));
 }
 public static async Task <MyNFirstObservableCollectionImpl <TItem> > CreateInstance <TItem>(
     IMyNotifyCollectionChanged <TItem> collection,
     IMyObservableCollectionProxyN proxyN
     )
 {
     return(await MyNFirstObservableCollectionImpl <TItem> .CreateInstance(
                collection,
                proxyN
                ).ConfigureAwait(false));
 }
 public static async Task <MyOrderedObservableCollection <TItem> > CreateInstance <TItem>(
     IMyNotifyCollectionChanged <TItem> collection,
     IMyObservableCollectionProxyComparer <TItem> proxyComparer
     )
 {
     return(await MyOrderedObservableCollection <TItem> .CreateInstance(
                collection,
                proxyComparer
                ).ConfigureAwait(false));
 }
 public static async Task <ListViewCollectionChangedOneWayBinding <TItem> > CreateInstance <TItem>(
     ListView listView,
     IMyNotifyCollectionChanged <TItem> collection,
     Func <ListView, ListViewItem> newItemConstructor,
     Action <TItem, ListViewItem> editItemAction // Old value, new value, listViewItem
     )
 {
     return(await ListViewCollectionChangedOneWayBinding <TItem> .CreateInstance(
                listView,
                collection,
                newItemConstructor,
                editItemAction
                ).ConfigureAwait(false));
 }
Exemplo n.º 6
0
 public static async Task <MyJoinedObservableCollectionImpl <TItem1, TItem2> > CreateInstance <TItem1, TItem2>(
     IMyNotifyCollectionChanged <TItem1> collectionChanged1,
     IMyNotifyCollectionChanged <TItem2> collectionChanged2,
     Func <TItem1, TItem2, bool> comparisonPredicate,
     JoinType joinType
     )
     where TItem1 : class
     where TItem2 : class
 {
     return(await MyJoinedObservableCollectionImpl <TItem1, TItem2> .CreateInstance(
                collectionChanged1,
                collectionChanged2,
                comparisonPredicate,
                joinType
                ).ConfigureAwait(false));
 }
 public static async Task <MyHotSwapObservableCollectionImpl <TItem> > CreateInstance <TItem>(
     IMyNotifyCollectionChanged <TItem> firstCollection
     )
 {
     return(await MyHotSwapObservableCollectionImpl <TItem> .CreateInstance(firstCollection).ConfigureAwait(false));
 }