public override void ResponseReceived(byte[] parameter) { switch ((FileExplorerCommunication)parameter[0]) { case FileExplorerCommunication.ResponseDtpPackage: _dtpFactory.Receive(parameter, 1); break; case FileExplorerCommunication.ResponseDownloadPackage: DownloadPackageReceived?.Invoke(this, parameter); break; case FileExplorerCommunication.ResponsePackagingDirectory: break; case FileExplorerCommunication.ResponseCopyingFile: break; case FileExplorerCommunication.ResponseProcessingEntryChanged: ProcessingEntryUpdateReceived?.Invoke(this, _processingEntryUpdateSerializer.Value.Deserialize <ProcessingEntryUpdate>(parameter, 1)); break; case FileExplorerCommunication.ResponseDownloadFailed: DownloadFailed?.Invoke(this, new Guid(parameter.Skip(1).ToArray())); break; case FileExplorerCommunication.ResponseProcessingEntryAdded: ProcessingEntryAdded?.Invoke(this, _processingEntrySerializer.Value.Deserialize <ProcessingEntry>(parameter, 1).Unpack(null)); break; } }
public override void ResponseReceived(byte[] parameter) { switch ((ConnectionInitializerCommunication)parameter[0]) { case ConnectionInitializerCommunication.ResponseDtpData: _dtpFactory.Receive(parameter, 1); break; default: throw new ArgumentOutOfRangeException(); } }
private void SendData(byte[] data) { _dtpFactory.Receive(_dtpProcessor.Receive(data)); }