Class WritingDataSource
- Namespace
 - ChartTools.IO.Sources
 
- Assembly
 - ChartTools.dll
 
Represents a combination of a data source that can be written to and a ReadingDataSource to combine data with.
public class WritingDataSource : DataSource, IDisposable
  - Inheritance
 - 
      
      
      WritingDataSource
 
- Implements
 
- Inherited Members
 
Remarks
Constructors
WritingDataSource(Stream, ReadingDataSource?)
Creates a WritingDataSource from a Stream.
public WritingDataSource(Stream stream, ReadingDataSource? existing = null)
  Parameters
streamStreamStream to source from. Must be readable through CanRead and seekable through CanSeek.
existingReadingDataSourceSource of existing data to combine during write operations 
Remarks
The stream is kept alive after the lifetime of the WritingDataSource.
Exceptions
- ArgumentException
 The stream is not seekable and/or writable
WritingDataSource(string, ReadingDataSource?)
Creates a WritingDataSource from a file path.
public WritingDataSource(string path, ReadingDataSource? existing = null)
  Parameters
pathstringPath of the file to source from
existingReadingDataSourceSource of existing data to combine during write operations . If null, uses the writing path if the file already exists.
Remarks
Initializes the stream as a FileStream with Write and Read.
The stream is disposed when disposing the WritingDataSource.
Properties
Existing
Source of existing data to combine during write operations
public ReadingDataSource? Existing { get; }
  Property Value
Remarks
Can point to the same file or share a Stream instance with the WritingDataSource.
Methods
Dispose()
Disposes the reading source if provided and stream if generated.
public override void Dispose()
  Operators
implicit operator WritingDataSource(Stream)
Creates a WritingDataSource from a Stream as a target and source of existing data.
public static implicit operator WritingDataSource(Stream stream)
  Parameters
streamStreamStream to create from
Returns
Remarks
The stream is kept alive after the lifetime of the WritingDataSource.
implicit operator WritingDataSource(string)
Creates a WritingDataSource from a file path as a target and source of existing data.
public static implicit operator WritingDataSource(string path)
  Parameters
pathstringPath to create from
Returns
Remarks
Initializes the stream as a FileStream with Write and Read.
The stream is disposed when disposing the WritingDataSource.