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);
        }
Exemple #2
0
 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);
 }
Exemple #4
0
 internal void HandleStreamReceived(object sender, StreamReceivedFromServerEventArgs args)
 {
     CatchAndReport(() => StreamReceived?.Invoke(sender, args), "StreamReceived", sender);
 }