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