private void WriteFileStream(FileSystemInfo directory, TransportFileDelivery delivery, bool overwrite) { var fileName = delivery.TransportFile.Name; var filePath = Path.Combine(directory.FullName, fileName); if (overwrite) { DeleteExistingFile(delivery, directory); } using (var fs = new FileStream(filePath, FileMode.Append, FileAccess.Write, FileShare.Read)) delivery.TransportFile.WriteTo(fs); StreamReceived?.Invoke(filePath); }
internal void HandleStreamReceived(object sender, StreamReceivedEventArgs args) { WrappedEventHandler(() => StreamReceived?.Invoke(sender, args), "StreamReceived", sender); }
internal void HandleStreamReceived(object sender, StreamReceivedFromClientEventArgs args) { StreamReceived?.Invoke(sender, args); }
internal void HandleStreamReceived(object sender, StreamReceivedFromServerEventArgs args) { CatchAndReport(() => StreamReceived?.Invoke(sender, args), "StreamReceived", sender); }