Request

Response

    GeometryConversionExtensions.AsStreamGeometryAsync method (1 of 2)

    Asynchronously converts an ElementGeometry to a StreamGeometry by reading the file data into memory.

    public static Task<StreamGeometry> AsStreamGeometryAsync(this ElementGeometry elementGeometry, 
        CancellationToken cancellationToken = default)
    
    parameterdescription
    elementGeometry The ElementGeometry to convert. Must be a FileGeometry.
    cancellationToken Cancellation token for the async operation.

    Return Value

    A task that resolves to a StreamGeometry containing the file data in memory.

    Exceptions

    exceptioncondition
    ArgumentNullException Thrown when elementGeometry is null.
    ArgumentException Thrown when elementGeometry is not a FileGeometry.
    FileNotFoundException Thrown when the file does not exist.

    See Also


    GeometryConversionExtensions.AsStreamGeometryAsync method (2 of 2)

    Asynchronously converts a FileGeometry to a StreamGeometry by reading the file data into memory.

    public static Task<StreamGeometry> AsStreamGeometryAsync(this FileGeometry fileGeometry, 
        CancellationToken cancellationToken = default)
    
    parameterdescription
    fileGeometry The FileGeometry to convert.
    cancellationToken Cancellation token for the async operation.

    Return Value

    A task that resolves to a StreamGeometry containing the file data in memory.

    Exceptions

    exceptioncondition
    ArgumentNullException Thrown when fileGeometry is null.
    FileNotFoundException Thrown when the file does not exist.

    See Also