Class DataStreamSupporter
The data stream container.
public abstract class DataStreamSupporter : DisposableObject, IDisposable
- Inheritance
-
DataStreamSupporter
- Implements
- Derived
- Inherited Members
Constructors
DataStreamSupporter()
Initializes a new instance of the DataStreamSupporter class.
protected DataStreamSupporter()
Fields
timeout
The timeout to wait for synchronization
protected int timeout
Field Value
Properties
DataStreamContainer
Gets the object's data stream.
public StreamContainer DataStreamContainer { get; }
Property Value
- StreamContainer
The object's data stream.
IsCached
Gets a value indicating whether object's data is cached currently and no data reading is required.
public abstract bool IsCached { get; }
Property Value
- bool
true
if object's data is cached; otherwise,false
.
Methods
CacheData()
Caches the data and ensures no additional data loading will be performed from the underlying DataStreamContainer.
public abstract void CacheData()
OnDataStreamContainerChanging(StreamContainer)
Called when data stream container is changing.
protected virtual void OnDataStreamContainerChanging(StreamContainer streamContainer)
Parameters
streamContainer
StreamContainerThe stream container.
ReleaseManagedResources()
Releases the managed resources. Make sure no unmanaged resources are released here, since they may have been already released.
protected override void ReleaseManagedResources()
Save()
Saves the object's data to the current DataStreamSupporter.
public virtual void Save()
Save(Stream)
Saves the object's data to the specified stream.
public void Save(Stream stream)
Parameters
stream
StreamThe stream to save the object's data to.
Save(string)
Saves the object's data to the specified file location.
public virtual void Save(string filePath)
Parameters
filePath
stringThe file path to save the object's data to.
Save(string, bool)
Saves the object's data to the specified file location.
public virtual void Save(string filePath, bool overWrite)
Parameters
filePath
stringThe file path to save the object's data to.
overWrite
boolif set to
true
over write the file contents, otherwise append will occur.
SaveData(Stream)
Saves the data.
protected abstract void SaveData(Stream stream)
Parameters
stream
StreamThe stream to save data to.