示例#1
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();
            }
示例#2
0
 public CollectionChangeAppliedEventArgs(ICollectionChangeBundle <ItemType, ContentType> bundle, AsyncEventSequence eventSequence)
 {
     this.bundle        = bundle ?? throw new ArgumentNullException(nameof(bundle));
     AsyncEventSequence = eventSequence ?? throw new ArgumentNullException(nameof(eventSequence));
 }
示例#3
0
 public ConversionCollectionChangeBundles(ICollectionChangeBundle <ItemType, ContentType> convertedBundle,
                                          ICollectionChangeBundle <ContentType, OriginContentType> originBundle)
 {
     ConvertedBundle = convertedBundle;
     OriginBundle    = originBundle;
 }
示例#4
0
 public void RelayCollectionChange(ICollectionChangeBundle <ContentType, OriginContentType> originBundle) =>
 AsyncHelper.RunSynchronous(() => RelayCollectionChangeAsync(originBundle));
示例#5
0
            private ApplyingCollectionChangeBundle createApplyingCollectionChangeConversionBundle(ICollectionChangeBundle <ContentType, OriginContentType> originBundle)
            {
                var originContentContentChange = originBundle.ItemItemChange;
                var convertedItemContentChange = synchronizer.CreateItemContentCollectionChange(originContentContentChange);

                return(new ApplyingCollectionChangeBundle(convertedItemContentChange, originContentContentChange));
            }
示例#6
0
        private void applyCollectionChange(ICollectionChange <ContentType, ContentType> contentContentChange, out ICollectionChangeBundle <ItemType, ContentType> appliedBundle)
        {
            var itemContentChange = CreateItemContentCollectionChange(contentContentChange);
            var applyingBundle    = new ApplyingCollectionChangeBundle(itemContentChange, contentContentChange);

            ApplyCollectionChangeBundle(applyingBundle);
            appliedBundle = GetAppliedCollectionChangeBundle(applyingBundle);
        }