예제 #1
0
        public virtual async Task ApplyCollectionChangeAsync(ICollectionChange <ContentType, ContentType> contentContentChange)
        {
            applyCollectionChange(contentContentChange, out var appliedBundle);
            var eventSequence = new AsyncEventSequence();
            var args          = new CollectionChangeAppliedEventArgs <ItemType, ContentType>(appliedBundle, eventSequence);

            OnCollectionChangeApplied(args);
            await eventSequence.FinishDependenciesAsync();
        }
예제 #2
0
            public async Task RelayCollectionChangeAsync(ICollectionChangeBundle <ContentType, OriginContentType> originBundle)
            {
                var convertedApplyingBundle = createApplyingCollectionChangeConversionBundle(originBundle);

                synchronizer.ApplyCollectionChangeBundle(convertedApplyingBundle);
                var convertedAppliedBundle = synchronizer.GetAppliedCollectionChangeBundle(convertedApplyingBundle);
                var convertedChangeAppliedEventSequence = new AsyncEventSequence();
                var convertedChangeAppliedArgs          = new CollectionChangeAppliedEventArgs <ItemType, ContentType>(convertedAppliedBundle, convertedChangeAppliedEventSequence);

                synchronizer.OnCollectionChangeApplied(convertedChangeAppliedArgs);
                await convertedChangeAppliedEventSequence.FinishDependenciesAsync();

                var conversionBundles = new ConversionCollectionChangeBundles(convertedAppliedBundle, originBundle);
                var changeConversionAppliedEventSequence = new AsyncEventSequence();
                var changeConversionAppliedArgs          = CollectionChangeConversionAppliedEventArgs <ItemType, ContentType, OriginContentType> .CreateAsynchronous(conversionBundles, changeConversionAppliedEventSequence);

                OnCollectionChangeConversionApplied(changeConversionAppliedArgs);
                await convertedChangeAppliedEventSequence.FinishDependenciesAsync();
            }
예제 #3
0
        public virtual async Task ApplyCollectionChangeAsync(ICollectionChange <ItemType, ContentType> itemContentChange)
        {
            BeginWork();

            try {
                applyCollectionChange(itemContentChange, out var appliedBundle);
                var eventSequence = new AsyncEventSequence();
                var args          = new CollectionChangeAppliedEventArgs <ItemType, ContentType>(appliedBundle, eventSequence);
                OnCollectionChangeApplied(args);
                await eventSequence.FinishDependenciesAsync();
            } finally {
                EndWork();
            }
        }