Ejemplo n.º 1
0
        public MainShellViewModel(IResultFactory resultFactory,
                                  IEventAggregator eventAggregator,
                                  IPersistanceManager persistanceManager,
                                  ISettingsManager settingsManager,
                                  MainMenuViewModel mainMenuViewModel,
                                  ConsoleViewModel consoleViewModel,
                                  ErrorViewModel errorViewModel,
                                  WatchesViewModel watchesViewModel,
                                  IFileSystem fileSystem,
                                  ScriptDialogStrategy scriptDialogStrategy,
                                  IPaths paths
                                  )
            : base(resultFactory)
        {
            this.eventAggregator = eventAggregator;
            eventAggregator.Subscribe(this);
            this.persistanceManager   = persistanceManager;
            this.fileSystem           = fileSystem;
            this.scriptDialogStrategy = scriptDialogStrategy;
            this.paths = paths;

            Scripts = new BindableCollection <ScriptEditorViewModel>();
            Tools   = new BindableCollection <PanelViewModel> {
                consoleViewModel, errorViewModel, watchesViewModel
            };

            Menu         = mainMenuViewModel;
            Menu.Plugins =
                settingsManager.ListConfigurablePluginSettings().Select(ps => new PluginSettingsMenuViewModel(ps));
            Menu.HelpFiles =
                settingsManager.ListPluginSettingsWithHelpFile().Select(ps => new PluginHelpFileViewModel(ps)).ToList();
            Menu.Views = Tools;

            DisplayName = "FreePIE - Programmable Input Emulator";
        }
Ejemplo n.º 2
0
        public ModuleController(IEnvironmentService environmentService, IPresentationService presentationService, ShellService shellService,
                                Lazy <FileController> fileController, Lazy <RichTextDocumentController> richTextDocumentController, Lazy <PrintController> printController,
                                Lazy <ShellViewModel> shellViewModel, Lazy <MainViewModel> mainViewModel, Lazy <StartViewModel> startViewModel, Lazy <IPowerShellService> powerShellService,
                                Lazy <ConsoleViewModel> consoleViewModel)
        {
            // Upgrade the settings from a previous version when the new version starts the first time.
            if (Settings.Default.IsUpgradeNeeded)
            {
                Settings.Default.Upgrade();
                Settings.Default.IsUpgradeNeeded = false;
            }

            // Initializing the cultures must be done first. Therefore, we inject the Controllers and ViewModels lazy.
            InitializeCultures();
            presentationService.InitializeCultures();

            this._environmentService         = environmentService;
            this._fileController             = fileController.Value;
            this._richTextDocumentController = richTextDocumentController.Value;
            this._printController            = printController.Value;
            this._shellViewModel             = shellViewModel.Value;
            this._mainViewModel    = mainViewModel.Value;
            this._startViewModel   = startViewModel.Value;
            this._consoleViewModel = consoleViewModel.Value;

            shellService.ShellView        = this._shellViewModel.View;
            this._shellViewModel.Closing += ShellViewModelClosing;
            this._exitCommand             = new DelegateCommand(Close);

            powerShellService.Value.Initialize();
        }
Ejemplo n.º 3
0
        public ShiftInfo(Shift shift, Employee employee)
        {
            InitializeComponent();
            SelectedSchedule  = shift;
            CurrentUser       = employee;
            _ConsoleViewModel = new ConsoleViewModel();
            _ConsoleViewModel.InitializeViewModelData();
            Shift_Id    = SelectedSchedule.ShiftID;
            DateOfShift = SelectedSchedule.DateOfShift.ToShortDateString();
            Start_Time_ = SelectedSchedule.StartTime.ToShortTimeString();
            End_Time_   = SelectedSchedule.EndTime.ToShortTimeString();

            if (SelectedSchedule.AvailableEmployees.Exists(x => x.ID == _CurrentUser.ID) == true)
            {
                IsAvailable    = true;
                IsNotAvailable = !IsAvailable;
            }
            else
            {
                IsAvailable    = false;
                IsNotAvailable = !IsAvailable;
            }


            this.DataContext = this;
        }
        public async Task NewSessionAndCancel()
        {
            ConsoleViewModel consoleViewModel = new ConsoleViewModel(
                new StubConsoleService(),
                new StubSerialPortService(),
                new StubSettingsService(),
                new StubClipboardService(),
                new StubDialogService(),
                new StubApplicationServices(),
                new StubWindowService(),
                new StubPrinterService(),
                new StubTaskHelpers());

            consoleViewModel.Initialize();

            StubWindowService.StubDialogResult = false;

            var newsSessionCommand = consoleViewModel.NewSessionCommand
                                     .AsAsyncRelayCommand();

            await newsSessionCommand.ExecuteAsync();

            Assert.IsTrue(StubWindowService.StubWindow == "SessionSetupWindow");
            Assert.IsFalse(consoleViewModel.IsSessionOpen);

            var endSessionCommand = consoleViewModel.EndSessionCommand;

            endSessionCommand.Execute(null);
        }
Ejemplo n.º 5
0
 public IActionResult RunProcess(ConsoleViewModel viewModel)
 {
     _l4D2AppHost.HostSettings.RedirectStandardInput = viewModel.HostSettings.RedirectStandardInput;
     _l4D2AppHost.HostSettings.ShowWindow            = viewModel.HostSettings.ShowWindow;
     _l4D2AppHost.Run();
     return(RedirectToAction("Index"));
 }
        public ConsoleView()
        {
            InitializeComponent();

            DataContext = new ConsoleViewModel();
            ((INotifyCollectionChanged)FeatureHolder.Items).CollectionChanged += ListView_CollectionChanged;
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Instantiate ConsoleView
        /// </summary>
        public ConsoleView()
        {
            InitializeComponent();

            //Routing.EventManager.GetInstance().ClearAllIOEvent += () =>
            Events.SubscribeEvent("ClearAllIO", new Action(() =>
            {
                if (DataContext is ConsoleViewModel)
                {
                    ((ConsoleViewModel)DataContext).TextLines = "";
                }
            }));

            this.DataContextChanged += ConsoleView_DataContextChanged;

            #region TextBox Events for inputting

            txtOutput.TextChanged += (s, e) => txtOutput.CaretIndex = txtOutput.Text.Length;

            bool isDirty = true;
            txtOutput.SelectionChanged += (s, e) =>
            {
                isDirty = !isDirty;
                if (!isDirty)
                {
                    txtOutput.CaretIndex = txtOutput.Text.Length;
                }
            };

            txtOutput.PreviewKeyDown += (s, e) => {
                if (!(DataContext is ConsoleViewModel))
                {
                    return;
                }

                ConsoleViewModel vm = (ConsoleViewModel)DataContext;

                switch (e.Key)
                {
                case Key.Enter:
                    vm.EndInput(txtOutput.Text);
                    break;

                case Key.Escape:
                    vm.EndInput(txtOutput.Text);
                    break;

                case Key.Back:
                    e.Handled = txtOutput.Text.Length <= vm.InputStart;
                    break;

                default:
                    break;
                }
            };

            #endregion
        }
Ejemplo n.º 8
0
 private void SetupOutputWindow()
 {
     lookLikeConsoleText = Application.Current.FindResource("ConsoleText") as Style;
     cmdOut = new ConsoleOutputs();
     //   cmdOut.InitializeComponent();
     cmdOut.Show();
     outputController = new ConsoleViewModel(cmdOut);
     DisplayHeaderMessage();
 }
Ejemplo n.º 9
0
        private void Initialize()
        {
            Logger.debug("Initalizing components", origin: "ChatMail.ConsolePresenter");

            List <LogEntry> logEntries = m_consoleDao.GetLogEntries();

            m_consoleViewModel = ResolveViewModel(logEntries);

            m_consoleView.DisplayDebug(m_consoleViewModel);
        }
 public ConsoleWindow(RCONClient rcon)
 {
     InitializeComponent();
     _vmConsole  = ConsoleViewModel.INSTANCE;
     DataContext = _vmConsole;
     _rconClient = rcon;
     _vmConsole.ConsoleMonitor.Add(
         "[" + DateTime.Now + "] " +
         "Initialize Complete! Try \"list\" to see who is online.");
 }
Ejemplo n.º 11
0
        public void DisplayDebug(ConsoleViewModel viewModel)
        {
            Logger.debug("Displaying debug messages", origin: "ChatMail.ConsoleView");
            consoleViewListBox.Items.Clear();

            foreach (LogEntry entry in viewModel.LogEntries)
            {
                consoleViewListBox.Items.Add(entry.Display());
            }
        }
Ejemplo n.º 12
0
        public ActionResult Console()
        {
            ViewBag.AlertType    = TempData["AlertType"];
            ViewBag.AlertContent = TempData["AlertContent"];
            AbstractManager  manager = new AbstractManager();
            ConsoleViewModel model   = new ConsoleViewModel();

            model.ShowList = manager.GetListOnShow();
            model.WaitList = manager.GetWaitingList();
            return(View(model));
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Instantiate a TextBoxReader
        /// </summary>
        /// <param name="model">The ConsoleViewModel it is reading from</param>
        public TextBoxReader(ConsoleViewModel model)
        {
            Model = model;

            Events.SubscribeEvent("OnDestroyed", new Action(() => m_Abort = true));
            Events.SubscribeEvent("OnTerminateExecution", new Action <Action>((x) => m_Abort = true));
            m_Index = 0;

            m_Input    = String.Empty;
            m_HasInput = false;
            m_Abort    = false;
        }
Ejemplo n.º 14
0
 public ConsoleView()
 {
     ViewModel = new ConsoleViewModel();
     App.RustRcon.ConsoleLogUpdated += (s, args) =>
     {
         if (ViewModel.ConsoleSettings.IsAutoScrollEnabled)
         {
             ConsoleScrollViewer.ScrollToBottom();
         }
     };
     InitializeComponent();
 }
Ejemplo n.º 15
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var viewmodel = new ConsoleViewModel(
                new GenerateNewWeapon(
                    new GenerateWeaponName(),
                    new GenerateDamageType(),
                    new GenerateDamageStat()));

            new Console()
            {
                DataContext = viewmodel
            }.ShowDialog();
        }
Ejemplo n.º 16
0
        public void ShowCurrentConsoleHasNotBeenElevatedYetMessage_should_show_the_message()
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var vm = new ConsoleViewModel();

            // Act
            vm.ShowCurrentConsoleHasNotBeenElevatedYetMessage();


            // Assert
            Assert.IsNotNullOrEmpty(vm.Message.Value);
        }
Ejemplo n.º 17
0
        public void ReportNuGetPackageCreatingProgress_should_report_the_progress()
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var pkgName = fixture.Create <string>();

            var vm = new ConsoleViewModel();

            // Act
            vm.ReportNuGetPackageCreatingProgress(pkgName);


            // Assert
            Assert.That(vm.Message.Value, Is.StringMatching(pkgName));
        }
Ejemplo n.º 18
0
        public void ReportProfilerStatusCheckingProgress_should_report_the_progress()
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var pathOfInstalling = fixture.Create <string>();
            var profLoc          = new ProfilerLocation(RegistryView.Registry64, pathOfInstalling);

            var vm = new ConsoleViewModel();

            // Act
            vm.ReportProfilerStatusCheckingProgress(profLoc);


            // Assert
            Assert.That(vm.Message.Value, Is.StringMatching(pathOfInstalling));
        }
Ejemplo n.º 19
0
        public ConsoleViewModel BuildModel()
        {
            User user = GetUser();

            /*
             * if (user.Inventory.Count == 0) {
             * List<InventoryItem> invItems = _context.InventoryItems.Where(ii => ii.UserID == user.UserID).ToList();
             * foreach (InventoryItem item in invItems)
             * {
             *  user.Inventory.Add(_context.Item.Where(i => i.ItemID == item.ItemID).FirstOrDefault());
             * }
             * }
             */
            Screen screen = _context.Screen.Include(s => s.ScreenInventory).Where(s => s.ScreenID == user.Screen).FirstOrDefault();

            /*
             * List<InventoryItem> inventory = _context.InventoryItems.Where(inv => inv.UserID == user.UserID).ToList();
             * foreach (InventoryItem invItem in inventory)
             * {
             *  user.Inventory.Add(_context.Item.Where(i => i.ItemID == invItem.ItemID).FirstOrDefault());
             * }
             * SaveUser(user);
             */

            Chest chest = new Chest();

            foreach (ScreenItem si in screen.ScreenInventory)
            {
                si.Item = _context.Item.Where(i => i.ItemID == si.ItemID).FirstOrDefault();
                chest.ParentContainer = si.Item;
                List <InventoryItem> items = _context.InventoryItems.Where(i => i.ScreenItemID == si.ScreenItemID).ToList();
                foreach (InventoryItem inv in items)
                {
                    chest.ItemsInside.Add(inv.InventoryItemID, _context.Item.Where(i => i.ItemID == inv.ItemID).FirstOrDefault());
                }
            }
            ConsoleViewModel model = new ConsoleViewModel();

            model.User         = user;
            model.Log          = _context.FightLogs.Where(l => l.UserID == user.UserID).ToList();
            model.AccessPoints = _context.AccessPoint.Where(a => a.From == user.Screen).ToList();
            model.Screen       = screen;
            model.Chest        = chest;
            return(model);
        }
Ejemplo n.º 20
0
        public void EndCompletedMachineWideProcessProgress_should_report_the_progress(
            [Values(MachineWideProcesses.Installing, MachineWideProcesses.Uninstalling)]
            MachineWideProcesses mwProc)
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var vm = new ConsoleViewModel();
            vm.BeginMachineWideProcessProgress(mwProc);
            vm.ShowCompletedMachineWideProcessMessage();

            // Act
            vm.EndCompletedMachineWideProcessProgress();

            // Assert
            Assert.IsNotNullOrEmpty(vm.Message.Value);
            Assert.AreEqual(0, vm.ExitCode.Value);
        }
Ejemplo n.º 21
0
        private void UserControl_DataContextChanged_1(object sender, DependencyPropertyChangedEventArgs e)
        {
            ConsoleViewModel tmpOldVM = e.OldValue as ConsoleViewModel;

            if (tmpOldVM != null)
            {
                tmpOldVM.SearchVM.FindNext -= OnSearchVM_FindNext;
            }

            ConsoleViewModel tmpNewVM = e.NewValue as ConsoleViewModel;

            if (tmpNewVM != null)
            {
                tmpNewVM.SearchVM.FindNext += OnSearchVM_FindNext;
            }

            this.txtCommand.Focus();
        }
Ejemplo n.º 22
0
        public void ReportEnvironmentVariableProcessedProgress_should_report_the_progress(
            [Values(MachineWideProcesses.Installing, MachineWideProcesses.Uninstalling)]
            MachineWideProcesses mwProc)
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var vm = new ConsoleViewModel();

            vm.BeginMachineWideProcessProgress(mwProc);

            // Act
            vm.ReportEnvironmentVariableProcessedProgress();


            // Assert
            Assert.IsNotNullOrEmpty(vm.Message.Value);
        }
Ejemplo n.º 23
0
        public void ShowSkippedMachineWideProcessMessage_should_show_the_message(
            [Values(MachineWideProcesses.Installing, MachineWideProcesses.Uninstalling)]
            MachineWideProcesses mwProc,
            [Values(SkippedReasons.AlreadyRegistered, SkippedReasons.Error)]
            SkippedReasons reason)
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var vm = new ConsoleViewModel();

            vm.BeginMachineWideProcessProgress(mwProc);

            // Act
            vm.ShowSkippedMachineWideProcessMessage(reason);


            // Assert
            Assert.IsNotNullOrEmpty(vm.Message.Value);
        }
Ejemplo n.º 24
0
        public void EndCompletedMachineWideProcessProgress_should_report_the_progress(
            [Values(MachineWideProcesses.Installing, MachineWideProcesses.Uninstalling)]
            MachineWideProcesses mwProc)
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var vm = new ConsoleViewModel();

            vm.BeginMachineWideProcessProgress(mwProc);
            vm.ShowCompletedMachineWideProcessMessage();

            // Act
            vm.EndCompletedMachineWideProcessProgress();


            // Assert
            Assert.IsNotNullOrEmpty(vm.Message.Value);
            Assert.AreEqual(0, vm.ExitCode.Value);
        }
Ejemplo n.º 25
0
        public void EndSkippedMachineWideProcessProgress_should_report_the_progress(
            [Values(MachineWideProcesses.Installing, MachineWideProcesses.Uninstalling)]
            MachineWideProcesses mwProc,
            [Values(SkippedReasons.AlreadyRegistered, SkippedReasons.Error)]
            SkippedReasons reason)
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var vm = new ConsoleViewModel();
            vm.BeginMachineWideProcessProgress(mwProc);
            vm.ShowSkippedMachineWideProcessMessage(reason);

            // Act
            vm.EndSkippedMachineWideProcessProgress(reason);

            // Assert
            Assert.IsNotNullOrEmpty(vm.Message.Value);
            Assert.AreEqual(10 + (int)reason, vm.ExitCode.Value);
        }
Ejemplo n.º 26
0
        public void ReportProfilerProcessingProgress_should_report_the_progress(
            [Values(MachineWideProcesses.Installing, MachineWideProcesses.Uninstalling)]
            MachineWideProcesses mwProc)
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var pathOfInstalling = fixture.Create <string>();
            var profLoc          = new ProfilerLocation(RegistryView.Registry64, pathOfInstalling);

            var vm = new ConsoleViewModel();

            vm.BeginMachineWideProcessProgress(mwProc);

            // Act
            vm.ReportProfilerProcessingProgress(profLoc);


            // Assert
            Assert.That(vm.Message.Value, Is.StringMatching(pathOfInstalling));
        }
Ejemplo n.º 27
0
        public void ReportNuGetSourceProcessingProgress_should_report_the_progress(
            [Values(MachineWideProcesses.Installing, MachineWideProcesses.Uninstalling)]
            MachineWideProcesses mwProc)
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var path = fixture.Create <string>();
            var name = fixture.Create <string>();

            var vm = new ConsoleViewModel();

            vm.BeginMachineWideProcessProgress(mwProc);

            // Act
            vm.ReportNuGetSourceProcessingProgress(path, name);


            // Assert
            Assert.That(vm.Message.Value, Is.StringMatching(string.Format("({0})|({1})", path, name)));
        }
Ejemplo n.º 28
0
        private void ConsoleExtensionAppThread(object obj)
        {
            Thread.CurrentThread.SetApartmentState(ApartmentState.STA);
            try
            {
                _dispatcher = Dispatcher.CurrentDispatcher;
                _viewModel  = new ConsoleViewModel();
                "Console Extension App Thread Started".Log();
                _view      = new Mubox.Extensions.Console.Views.ConsoleView();
                _presenter = new System.Windows.Window();
                //_presenter.Title = (AppDomain.CurrentDomain.FriendlyName ?? "Default").Replace('.', ' ');
                _presenter.Title       = "Mubox Console";
                _presenter.Topmost     = true;
                _presenter.WindowStyle = WindowStyle.SingleBorderWindow;

                /* transparent window
                 * _presenter.WindowStyle = WindowStyle.None;
                 * _presenter.BorderThickness = new Thickness(1);
                 * _presenter.AllowsTransparency = true;
                 * _presenter.Background = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0));
                 */
                _presenter.DataContext = _viewModel;
                _presenter.Content     = _view;
                _view.Margin           = new Thickness(0);
                _presenter.Closing    += OnWindowClosing;
                // TODO: save/restore last-known size and position
                _presenter.WindowStartupLocation = WindowStartupLocation.Manual;
                _presenter.Width  = 512.0;
                _presenter.Height = 256;
                _presenter.Top    = 32;
                _presenter.Left   = 32;
                _application      = new System.Windows.Application();
                _application.Run(_presenter);
            }
            finally
            {
                "Console Extension App Thread Exiting".Log();
            }
        }
Ejemplo n.º 29
0
        private void ConsoleView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (DataContext is ConsoleViewModel)
            {
                ConsoleViewModel vm = (ConsoleViewModel)DataContext;

                TextBoxWriter Output = new TextBoxWriter(vm);
                TextBoxWriter Error  = new TextBoxWriter(vm);
                TextBoxReader Input  = new TextBoxReader(vm);

                vm.FocusEvent = () =>
                {
                    txtOutput.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
                    {
                        txtOutput.Focus();
                        Keyboard.Focus(txtOutput);
                    }));
                };

                //Routing.EventManager.ChangeIO(String.Empty, ConsoleModel.GetInstance().Output, ConsoleModel.GetInstance().Error, null);
                Events.InvokeEvent("SetIO", String.Empty, Output, Error, Input);
            }
        }
Ejemplo n.º 30
0
        public void ReportEnvironmentVariableProcessedProgress_should_report_the_progress(
            [Values(MachineWideProcesses.Installing, MachineWideProcesses.Uninstalling)]
            MachineWideProcesses mwProc)
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var vm = new ConsoleViewModel();
            vm.BeginMachineWideProcessProgress(mwProc);

            // Act
            vm.ReportEnvironmentVariableProcessedProgress();

            // Assert
            Assert.IsNotNullOrEmpty(vm.Message.Value);
        }
Ejemplo n.º 31
0
 public UpdateCommandListingCommand(ConsoleViewModel vm)
 {
     VM = vm;
 }
Ejemplo n.º 32
0
 public Console()
 {
     InitializeComponent();
     ViewModel        = new ConsoleViewModel();
     this.DataContext = ViewModel;
 }
Ejemplo n.º 33
0
        public void ReportNuGetPackageCreatingProgress_should_report_the_progress()
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var pkgName = fixture.Create<string>();

            var vm = new ConsoleViewModel();

            // Act
            vm.ReportNuGetPackageCreatingProgress(pkgName);

            // Assert
            Assert.That(vm.Message.Value, Is.StringMatching(pkgName));
        }
Ejemplo n.º 34
0
        public void ReportNuGetSourceProcessingProgress_should_report_the_progress(
            [Values(MachineWideProcesses.Installing, MachineWideProcesses.Uninstalling)]
            MachineWideProcesses mwProc)
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var path = fixture.Create<string>();
            var name = fixture.Create<string>();

            var vm = new ConsoleViewModel();
            vm.BeginMachineWideProcessProgress(mwProc);

            // Act
            vm.ReportNuGetSourceProcessingProgress(path, name);

            // Assert
            Assert.That(vm.Message.Value, Is.StringMatching(string.Format("({0})|({1})", path, name)));
        }
Ejemplo n.º 35
0
 protected ConsoleCommand(ConsoleViewModel vm)
     : base(vm)
 {
 }
Ejemplo n.º 36
0
 protected ConsoleCommand(ConsoleViewModel vm, IObservable<bool> canExecuteSource)
     : base(vm, canExecuteSource)
 {
 }
Ejemplo n.º 37
0
 public UnregisterPrigCommand(ConsoleViewModel vm)
     : base(vm)
 {
 }
Ejemplo n.º 38
0
        public void ShowCurrentConsoleHasNotBeenElevatedYetMessage_should_show_the_message()
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var vm = new ConsoleViewModel();

            // Act
            vm.ShowCurrentConsoleHasNotBeenElevatedYetMessage();

            // Assert
            Assert.IsNotNullOrEmpty(vm.Message.Value);
        }
 public AttachConsoleCommand(ConsoleViewModel vm)
 {
     VM = vm;
 }
Ejemplo n.º 40
0
        public void ReportProfilerProcessingProgress_should_report_the_progress(
            [Values(MachineWideProcesses.Installing, MachineWideProcesses.Uninstalling)]
            MachineWideProcesses mwProc)
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var pathOfInstalling = fixture.Create<string>();
            var profLoc = new ProfilerLocation(RegistryView.Registry64, pathOfInstalling);

            var vm = new ConsoleViewModel();
            vm.BeginMachineWideProcessProgress(mwProc);

            // Act
            vm.ReportProfilerProcessingProgress(profLoc);

            // Assert
            Assert.That(vm.Message.Value, Is.StringMatching(pathOfInstalling));
        }
Ejemplo n.º 41
0
        public void ReportProfilerStatusCheckingProgress_should_report_the_progress()
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoMoqCustomization());

            var pathOfInstalling = fixture.Create<string>();
            var profLoc = new ProfilerLocation(RegistryView.Registry64, pathOfInstalling);

            var vm = new ConsoleViewModel();

            // Act
            vm.ReportProfilerStatusCheckingProgress(profLoc);

            // Assert
            Assert.That(vm.Message.Value, Is.StringMatching(pathOfInstalling));
        }