Request

Response

    GeometryConversionExtensions.AsFileGeometryAsync method

    Asynchronously converts a StreamGeometry to a FileGeometry by writing the stream data to disk.

    public static Task<FileGeometry> AsFileGeometryAsync(this StreamGeometry streamGeometry, 
        string outputPath, CancellationToken cancellationToken = default)
    
    parameterdescription
    streamGeometry The StreamGeometry to convert.
    outputPath The file path where the geometry data will be written.
    cancellationToken Cancellation token for the async operation.

    Return Value

    A task that resolves to a FileGeometry pointing to the written file.

    Exceptions

    exceptioncondition
    ArgumentNullException Thrown when streamGeometry or outputPath is null.
    ArgumentException Thrown when outputPath is empty or whitespace.
    IOException Thrown when the file cannot be written.

    See Also