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(); }
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(); }
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(); } }