Пример #1
0
 /// <summary>
 /// Accepts a <see cref="IImageVisitor"/>.
 /// Implemented by <see cref="Image{TPixel}"/> invoking <see cref="IImageVisitor.Visit{TPixel}"/>
 /// with the pixel type of the image.
 /// </summary>
 /// <param name="visitor">The visitor.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 internal abstract Task AcceptAsync(IImageVisitorAsync visitor, CancellationToken cancellationToken);
Пример #2
0
        /// <inheritdoc />
        internal override Task AcceptAsync(IImageVisitorAsync visitor, CancellationToken cancellationToken)
        {
            this.EnsureNotDisposed();

            return(visitor.VisitAsync(this, cancellationToken));
        }
Пример #3
0
 /// <summary>
 /// Accepts a <see cref="IImageVisitor"/>.
 /// Implemented by <see cref="Image{TPixel}"/> invoking <see cref="IImageVisitor.Visit{TPixel}"/>
 /// with the pixel type of the image.
 /// </summary>
 /// <param name="visitor">The visitor.</param>
 internal abstract Task AcceptAsync(IImageVisitorAsync visitor);
Пример #4
0
        /// <inheritdoc />
        internal override Task AcceptAsync(IImageVisitorAsync visitor)
        {
            this.EnsureNotDisposed();

            return(visitor.VisitAsync(this));
        }
Пример #5
0
 /// <summary>
 /// Accepts a <see cref="IImageVisitor"/> to implement a double-dispatch pattern in order to
 /// apply pixel-specific operations on non-generic <see cref="Image"/> instances
 /// </summary>
 /// <param name="source">The source image.</param>
 /// <param name="visitor">The image visitor.</param>
 /// <returns>A  <see cref="Task"/> representing the asynchronous operation.</returns>
 public static Task AcceptVisitorAsync(this Image source, IImageVisitorAsync visitor)
 => source.AcceptAsync(visitor);
Пример #6
0
 /// <summary>
 /// Accepts a <see cref="IImageVisitor"/> to implement a double-dispatch pattern in order to
 /// apply pixel-specific operations on non-generic <see cref="Image"/> instances
 /// </summary>
 /// <param name="source">The source image.</param>
 /// <param name="visitor">The image visitor.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 /// <returns>A  <see cref="Task"/> representing the asynchronous operation.</returns>
 public static Task AcceptVisitorAsync(this Image source, IImageVisitorAsync visitor, CancellationToken cancellationToken = default)
 => source.AcceptAsync(visitor, cancellationToken);