Exemple #1
0
        private void DownloadFile(Attachment attachment)
        {
            var dialog = new FolderBrowserDialog();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                var dc = DownloadView.DataContext as DownloadViewModel;
                attachment.Path = dialog.SelectedPath;
                dc?.Files.Add(attachment);

                DownloadView.Show();
            }
        }
Exemple #2
0
        private void GetSystem()
        {
            foreach (var s in CommunicationViewModel.OpenConnections.Where(s => s.ConnectMode == ConnectMode.Install).Select(n => n.UnitId)
                     .Except(TabCollection.OfType <MainUnitViewModel>().Select(u => u.Id)))
            {
                AddMainUnit(s);
            }

            var nq = new DownloadView();

            nq.Title      = "Download to PC ESC => GUI";
            nq.Background = System.Windows.Media.Brushes.LightGreen;
            var qq = new CommunicationReceive(this);//  EscCommunicationBase(this);

            nq.DataContext = qq;
            nq.Show();
        }
Exemple #3
0
 private void SendUnitData()
 {
     if (TabCollection.OfType <MainUnitViewModel>().All(model => model.ConnectType == ConnectType.None))
     {
         MessageBox.Show(Main.MessageBoxUploadText, Main.MessageBoxUploadTitle,
                         MessageBoxButton.OK, MessageBoxImage.Question);
         SwitchToCommunicationTab();
     }
     else
     {
         var nq = new DownloadView
         {
             Title      = "UPLOAD to ESC: GUI => ESC",
             Background = System.Windows.Media.Brushes.LightCoral
         };
         var qq = new CommunicationSend(this);//  EscCommunicationBase(this);
         nq.DataContext = qq;
         nq.Show();
     }
 }