void InitializeFileService() { DisposeFileService(); _fileServer = new FileService(CommandDirectory); _fileServer.DataSent += _fileServer_DataSent; _fileServer.DataReceived += _fileServer_DataReceived; }
void DisposeFileService() { if (null != _fileServer) { _fileServer.Stop(); _fileServer.DataSent -= _fileServer_DataSent; _fileServer.DataReceived -= _fileServer_DataReceived; _fileServer = null; } }