C# Class Examples.ExamplesFileTransfer.WPF.ReceivedFile

A local class which can be used to populate the WPF list box
Inheritance: INotifyPropertyChanged
Show file Open project: MarcFletcher/NetworkComms.Net Class Usage Examples

Public Methods

Method Description
AddData ( long dataStart, int bufferStart, int bufferLength, byte buffer ) : void

Add data to file

Close ( ) : void

Closes and releases any resources maintained by this file

ReceivedFile ( string filename, ConnectionInfo sourceInfo, long sizeBytes ) : System

Create a new ReceivedFile

SaveFileToDisk ( string saveLocation ) : void

Saves the completed file to the provided saveLocation

Private Methods

Method Description
NotifyPropertyChanged ( string propertyName = "" ) : void

Triggers a GUI update on a property change

Method Details

AddData() public method

Add data to file
public AddData ( long dataStart, int bufferStart, int bufferLength, byte buffer ) : void
dataStart long Where to start writing this data to the internal memoryStream
bufferStart int Where to start copying data from buffer
bufferLength int The number of bytes to copy from buffer
buffer byte Buffer containing data to add
return void

Close() public method

Closes and releases any resources maintained by this file
public Close ( ) : void
return void

ReceivedFile() public method

Create a new ReceivedFile
public ReceivedFile ( string filename, ConnectionInfo sourceInfo, long sizeBytes ) : System
filename string Filename associated with this file
sourceInfo ConnectionInfo ConnectionInfo corresponding with the file source
sizeBytes long The total size in bytes of this file
return System

SaveFileToDisk() public method

Saves the completed file to the provided saveLocation
public SaveFileToDisk ( string saveLocation ) : void
saveLocation string Location to save file
return void