Пример #1
0
 public PackageManifestService(IFileTransferService fileTransferService, IFileSystem fileSystem, IStore <Config> configStore, Logger logger)
 {
     _fileTransferService = fileTransferService;
     _fileSystem          = fileSystem;
     _configStore         = configStore;
     _logger = logger;
 }
Пример #2
0
 public FileTransferWindowViewModel(
     Viewer viewer,
     IFileTransferService fileTransferService)
 {
     _fileTransferService = fileTransferService;
     _viewer            = viewer;
     ViewerName         = viewer.Name;
     ViewerConnectionId = viewer.ViewerConnectionID;
 }
Пример #3
0
        private async void UploadFileAsync(UploadFileInfo fileInfo)
        {
            var context  = new InstanceContext(this);
            var ftClient = new FileTransferServiceReference.FileTransferServiceClient(context);

            channel = ftClient.ChannelFactory.CreateChannel();

            await channel.UploadFileAsync(fileInfo);
        }
Пример #4
0
 public DtoMessageHandler(IKeyboardMouseInput keyboardMouseInput,
                          IAudioCapturer audioCapturer,
                          IClipboardService clipboardService,
                          IFileTransferService fileTransferService)
 {
     KeyboardMouseInput  = keyboardMouseInput;
     AudioCapturer       = audioCapturer;
     ClipboardService    = clipboardService;
     FileTransferService = fileTransferService;
 }
Пример #5
0
 public WebRtcSessionFactory(CasterSocket casterSocket,
                             IKeyboardMouseInput keyboardMouseInput,
                             IAudioCapturer audioCapturer,
                             IClipboardService clipboardService,
                             IFileTransferService fileDownloadService)
 {
     CasterSocket        = casterSocket;
     KeyboardMouseInput  = keyboardMouseInput;
     AudioCapturer       = audioCapturer;
     ClipboardService    = clipboardService;
     FileDownloadService = fileDownloadService;
 }
Пример #6
0
 public CasterSocket(
     IKeyboardMouseInput keyboardMouseInput,
     IScreenCaster screenCastService,
     IAudioCapturer audioCapturer,
     IFileTransferService fileDownloadService,
     IClipboardService clipboardService)
 {
     KeyboardMouseInput  = keyboardMouseInput;
     AudioCapturer       = audioCapturer;
     ScreenCaster        = screenCastService;
     FileDownloadService = fileDownloadService;
     ClipboardService    = clipboardService;
 }
Пример #7
0
 public RtcMessageHandler(Viewer viewer,
                          CasterSocket casterSocket,
                          IKeyboardMouseInput keyboardMouseInput,
                          IAudioCapturer audioCapturer,
                          IClipboardService clipboardService,
                          IFileTransferService fileDownloadService)
 {
     Viewer              = viewer;
     CasterSocket        = casterSocket;
     KeyboardMouseInput  = keyboardMouseInput;
     AudioCapturer       = audioCapturer;
     ClipboardService    = clipboardService;
     FileDownloadService = fileDownloadService;
 }
        private async void FileTransferPage_BackRequested(object sender, BackRequestedEventArgs e)
        {
            IFileTransferService service = AppObjects.Instance.Device.GetService(InkDeviceService.FileTransfer) as IFileTransferService;

            if ((service != null) && service.IsStarted)
            {
                await service.StopAsync(m_cts.Token);
            }

            if (Frame.CanGoBack)
            {
                Frame.GoBack();
            }
        }
Пример #9
0
 public InstallService(Logger logger, IFindInstaller findInstaller, IProcessController processController,
                       InstallerContextFactory installerContextFactory,
                       IFileTransferService fileTransferService, Func <InstallerBase[]> installWhisperers,
                       Func <UninstallerBase[]> uninstallers, IHub hub, IUnlocker unlocker, NovoClient novoClient, InstallerArgFactory argFactory)
 {
     _logger                  = logger;
     _findInstaller           = findInstaller;
     _processController       = processController;
     _installerContextFactory = installerContextFactory;
     _fileTransferService     = fileTransferService;
     _installWhisperers       = installWhisperers;
     _uninstallers            = uninstallers;
     _hub        = hub;
     _unlocker   = unlocker;
     _novoClient = novoClient;
     _argFactory = argFactory;
 }
        private async void FileTransferPage_Loaded(object sender, RoutedEventArgs e)
        {
            IDigitalInkDevice device = AppObjects.Instance.Device;

            device.Disconnected              += OnDeviceDisconnected;
            device.DeviceStatusChanged       += OnDeviceStatusChanged;
            device.PairingModeEnabledCallback = OnPairingModeEnabledAsync;

            IFileTransferService service = device.GetService(InkDeviceService.FileTransfer) as IFileTransferService;

            if (service == null)
            {
                textBlockPrompt.Text = "The File Transfer service is not supported on this device";
                return;
            }

            try
            {
                textBlockPrompt.Text = s_fileTransferPromptMessage;

                uint width = (uint)await device.GetPropertyAsync("Width", m_cts.Token);

                uint height = (uint)await device.GetPropertyAsync("Height", m_cts.Token);

                uint ptSize = (uint)await device.GetPropertyAsync("PointSize", m_cts.Token);

                service.Transform = AppObjects.CalculateTransform(width, height, ptSize);

                if (!service.IsStarted)
                {
                    await service.StartAsync(StrokesReceivedAsync, false, m_cts.Token);
                }
            }
            catch (Exception)
            {
            }
        }
Пример #11
0
        async void Upload()
        {
            IFileTransferService proxy = fileTransferServiceFactory.CreateChannel();

            try
            {
                string fileName = "f:\\xxx.mp4";
                // get some info about the input file
                System.IO.FileInfo fileInfo = new System.IO.FileInfo(fileName);



                // open input stream
                using (System.IO.FileStream stream = new System.IO.FileStream(fileName, System.IO.FileMode.Open, System.IO.FileAccess.Read))
                {
                    using (StreamWithProgress uploadStreamWithProgress = new StreamWithProgress(stream))
                    {
                        uploadStreamWithProgress.ProgressChanged += uploadStreamWithProgress_ProgressChanged;

                        // start service client

                        // upload file
                        proxy.UploadFileAsync(fileInfo.Name, fileInfo.Length, uploadStreamWithProgress);


                        // close service client
                    }
                }
            }
            catch (FaultException <SessionFault> sf)
            {
                string message   = sf.Detail.SessionMessage;
                string opertaion = sf.Detail.SessionOperation;
                string reson     = sf.Detail.SessionReason;
            }
            ((IClientChannel)proxy).Close();
        }
Пример #12
0
        private void GetFileAndStoreInCache(string path, IFileTransferService service)
        {
            Stream content = service.GetFileStream(path);

            _fileCache.StoreFile(path, content);
        }
Пример #13
0
 public ChunkingTransferServiceWrapper(IFileTransferService proxy)
 {
     m_Proxy = proxy;
 }
Пример #14
0
 public ChunkingTransferServiceWrapper()
 {
     m_Proxy = new FileTransferServiceProxy();
 }
Пример #15
0
 public FileTransferServiceTests()
 {
     _fileTransfer = TestServiceProvider.Current.GetRequiredService <IFileTransferService>();
 }
Пример #16
0
 public FileProcessor(ILogger <FileProcessor> logger, IFileTransferService transferService)
 {
     _logger          = logger;
     _transferService = transferService;
 }
Пример #17
0
 public FileTransferClient(IFileTransferService service, int transferChunkSize = DefaultTransferChunkSize)
 {
     Service           = service;
     TransferChunkSize = transferChunkSize;
     LocalStore        = new TempFileStore();
 }
 private void GetFileAndStoreInCache(string path, IFileTransferService service)
 {
     Stream content = service.GetFileStream(path);
     _fileCache.StoreFile(path, content);
 }