/// <inheritdoc cref="ReplaceImageEventArgs"/> public async Task OnEventHandler(object publisher, ReplaceImageEventArgs e) { try { var(to, from) = e.Container == ImageContainer.Source ? (ImageContainer.Destination, ImageContainer.Source) : (ImageContainer.Source, ImageContainer.Destination); if (!View.ImageIsDefault(from)) { var copy = await GetImageCopy(from) .ConfigureAwait(true); await Render( new PipelineBlock(copy), to ).ConfigureAwait(true); Aggregator.PublishFromAll(publisher, new ContainerUpdatedEventArgs(to, copy)); } } catch (OperationCanceledException ex) { OnError(publisher, Errors.CancelOperation); } catch (Exception ex) { OnError(publisher, Errors.ReplaceImage); } }
public virtual async Task OnEventHandler(object publisher, ReplaceImageEventArgs e) { }