示例#1
0
        internal IContinueResult Continue(int?threadId = null)
        {
            var cmd = new ContinueCommand(threadId);

            Session.Continue(cmd);
            return(cmd.Result);
        }
示例#2
0
        private async Task OnGetDataCommand()
        {
            _logger.Info("Getting supported games");

            if (Games == null)
            {
                Games = new ObservableCollection <GameModule>();
            }

            var supportedGames = _gameModuleCatalog.GameModules;

            foreach (var game in supportedGames)
            {
                if (Games.Any(x => x.Module == game.Module))
                {
                    continue;
                }

                game.InstalledLocation = await GameLocator.Find(game.Title);

                game.PropertyChanged += Game_PropertyChanged;
                Games.Add(game);
            }

            RaisePropertyChanged(nameof(Games));
            ContinueCommand.RaiseCanExecuteChanged();
        }
示例#3
0
        public void Continue()
        {
            ContinueCommand continueCommand = new ContinueCommand();

            continueCommand.InBackground = true;
            ExecuteCommand(continueCommand);
        }
示例#4
0
        public static void Continue()
        {
            Log("Request tutorial continue");

            var continueCommand = new ContinueCommand();

            IssueCommand(continueCommand);
        }
        private void CompleteScan(IEnumerable <Artist> artists)
        {
            IsCompleted = true;
            var data = GetSharedData();

            data.ScannedArtists = artists;

            //automatically navigate to next wizard step after scan is finished
            ContinueCommand.Execute(null);
        }
        public StocktakeNewViewModel(
            IMvvmNavigator mvvmNavigator,
            IInitialSetupService initialSetupService
            )
        {
            this.MvvmNavigator       = mvvmNavigator;
            this.InitialSetupService = initialSetupService;

            continueCommand = new ContinueCommand(this);
            continueCommand.CanExecuteProperty = true;
        }
示例#7
0
        private void OnViewLoadedCommand(object parameter)
        {
            var settings = CurrentUser.GetSettings();

            IsStepDisabledNextTime = !settings.ImportFirstStepVisible;

            if (!settings.ImportFirstStepVisible)
            {
                ContinueCommand.Execute(null);
            }
        }
示例#8
0
        public ExceptionViewModel(Exception exception, IApplicationService applicationService)
        {
            _exception          = exception;
            _applicationService = applicationService;

            OpenLogFolderCommand = ReactiveCommand.Create(Observable.Return(_applicationService.LogFolder != null))
                                   .DisposeWith(this);

            CopyCommand = ReactiveCommand.Create(Observable.Return(exception != null))
                          .DisposeWith(this);

            ContinueCommand = ReactiveCommand.Create()
                              .DisposeWith(this);

            ExitCommand = ReactiveCommand.Create()
                          .DisposeWith(this);

            RestartCommand = ReactiveCommand.Create()
                             .DisposeWith(this);

            OpenLogFolderCommand.ActivateGestures()
            .Subscribe(x => OpenLogFolder())
            .DisposeWith(this);

            CopyCommand.ActivateGestures()
            .Subscribe(x => Copy())
            .DisposeWith(this);

            ContinueCommand.ActivateGestures()
            .Subscribe(x => Continue())
            .DisposeWith(this);

            ExitCommand
            .ActivateGestures()
            .Subscribe(x => Exit())
            .DisposeWith(this);

            RestartCommand
            .ActivateGestures()
            .Subscribe(x => Restart())
            .DisposeWith(this);

            Closed.Take(1)
            .Subscribe(x =>
            {
                // Force all other potential exceptions to be realized
                // from the Finalizer thread to surface to the UI
                GC.Collect(2, GCCollectionMode.Forced);
                GC.WaitForPendingFinalizers();
            })
            .DisposeWith(this);
        }
        public void CreateContinueCommand()
        {
            // Arrange
            const int          commandId = 3;
            const SteppingKind stepping  = SteppingKind.Out;

            // Act
            var continueCommand = new ContinueCommand(commandId, stepping);

            // Assert
            Assert.AreEqual(commandId, continueCommand.Id);
            Assert.AreEqual(
                string.Format(
                    "{{\"command\":\"continue\",\"seq\":{0},\"type\":\"request\",\"arguments\":{{\"stepaction\":\"{1}\",\"stepcount\":1}}}}",
                    commandId, stepping.ToString().ToLower()),
                continueCommand.ToString());
        }
        private void OnBeginImportCommand(object parameter)
        {
            var markedItems      = GetMarkedItems();
            var validationResult = Validate(markedItems);

            if (!validationResult.Success)
            {
                Notify(validationResult.Message, NotificationType.Error);
            }
            else
            {
                IsBusy = true;

                Task <bool> importTask = Task.Factory.StartNew <bool>(() =>
                {
                    if (markedItems.Count() == 0)
                    {
                        return(true);
                    }

                    return(dataService.BulkImportData(markedItems));
                }, TaskScheduler.Default);

                Task finishImportTask = importTask.ContinueWith((r) =>
                {
                    IsBusy = false;

                    if (r.Result)
                    {
                        Notify("Import has been successful", NotificationType.Success);

                        ImportCompleted = true;

                        eventAggregator.GetEvent <ReloadAlbumsEvent>().Publish(null);
                        eventAggregator.GetEvent <ReloadArtistsEvent>().Publish(null);

                        //automatically navigate to next step in wizard
                        ContinueCommand.Execute(null);
                    }
                    else
                    {
                        Notify("Errors occured during import. Please see log for details", NotificationType.Error);
                    }
                }, TaskScheduler.FromCurrentSynchronizationContext());
            }
        }
示例#11
0
        public void CreateContinueCommandWithOptionalParameters()
        {
            // Arrange
            const int          commandId = 3;
            const SteppingKind stepping  = SteppingKind.Out;
            const int          stepCount = 3;

            // Act
            var continueCommand = new ContinueCommand(commandId, stepping, stepCount);

            // Assert
            Assert.AreEqual(commandId, continueCommand.Id);
            Assert.AreEqual(
                string.Format(
                    "{{\"command\":\"continue\",\"seq\":{0},\"type\":\"request\",\"arguments\":{{\"stepaction\":\"{1}\",\"stepcount\":{2}}}}}",
                    commandId, stepping.ToString().ToLower(CultureInfo.InvariantCulture), stepCount),
                continueCommand.ToString());
        }
        public ExceptionViewModel(Exception exception, IApplicationService applicationService)
        {
            _exception          = exception;
            _applicationService = applicationService;

            OpenLogFolderCommand = ReactiveCommand.Create(Observable.Return(_applicationService.LogFolder != null))
                                   .DisposeWith(this);

            CopyCommand = ReactiveCommand.Create(Observable.Return(exception != null))
                          .DisposeWith(this);

            ContinueCommand = ReactiveCommand.Create()
                              .DisposeWith(this);

            ExitCommand = ReactiveCommand.Create()
                          .DisposeWith(this);

            RestartCommand = ReactiveCommand.Create()
                             .DisposeWith(this);

            OpenLogFolderCommand.ActivateGestures()
            .Subscribe(x => OpenLogFolder())
            .DisposeWith(this);

            CopyCommand.ActivateGestures()
            .Subscribe(x => Copy())
            .DisposeWith(this);

            ContinueCommand.ActivateGestures()
            .Subscribe(x => Continue())
            .DisposeWith(this);

            ExitCommand
            .ActivateGestures()
            .Subscribe(x => Exit())
            .DisposeWith(this);

            RestartCommand
            .ActivateGestures()
            .Subscribe(x => Restart())
            .DisposeWith(this);
        }
 void SelectVideo(Video video)
 {
     ContinueCommand?.Execute(video);
 }
示例#14
0
文件: MainForm.cs 项目: mumant/Talker
 private void Continue()
 {
     ContinueCommand?.Invoke();
 }
示例#15
0
 private void Game_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     ContinueCommand.RaiseCanExecuteChanged();
 }
        public MainViewModel()
        {
            Activator = new ViewModelActivator();

            IsTimerRunning = false;

            this.WhenActivated(
                disposables => {
                Disposable
                // https://stackoverflow.com/a/5838632/12207453
                .Create(() => BuddyAvatarBitmap?.Dispose())
                .DisposeWith(disposables);
            });

            var canInitiateNewFetch =
                this.WhenAnyValue(vm => vm.Fetching, fetching => !fetching);

            // https://reactiveui.net/docs/handbook/commands/
            // https://reactiveui.net/docs/handbook/scheduling/
            // https://blog.jonstodle.com/task-toobservable-observable-fromasync-task/
            // https://github.com/reactiveui/ReactiveUI/issues/1245
            StalkCommand =
                ReactiveCommand.CreateFromObservable(
                    () => Observable.StartAsync(Stalk),
                    canInitiateNewFetch,
                    RxApp.MainThreadScheduler
                    );

            ContinueCommand =
                ReactiveCommand.CreateFromObservable(
                    () => Observable.StartAsync(Continue),
                    canInitiateNewFetch,
                    RxApp.MainThreadScheduler
                    );

            // Run the "Continue" command once in the beginning in order to fetch the first buddy.
            // https://reactiveui.net/docs/handbook/when-activated/#no-need
            ContinueCommand.Execute().Subscribe();

            // https://reactiveui.net/docs/handbook/commands/canceling#canceling-via-another-observable
            var startTimerCommand = ReactiveCommand.CreateFromObservable(
                () =>
                Observable
                .Return(Unit.Default)
                .Delay(TimeSpan.FromMilliseconds(DecisionTimeMilliseconds))
                .TakeUntil(
                    TriggeringTheTimer
                    .Where(trigger => trigger == TimerTrigger.Stop)));

            startTimerCommand.Subscribe(_ => ContinueCommand.Execute().Subscribe());

            this
            .WhenAnyObservable(vm => vm.TriggeringTheTimer)
            .Do(trigger => {
                if (trigger == TimerTrigger.Start)
                {
                    startTimerCommand.Execute().Subscribe();
                    IsTimerRunning = true;
                }
                else
                {
                    IsTimerRunning = false;
                }
            })
            .Subscribe();
        }
 private void AssignProperties(XmppState state)
 {
     SetConnectionStateAndText(state);
     ContinueCommand.ChangeCanExecute();
     SkipCommand.ChangeCanExecute();
 }
示例#18
0
        public void CoreDumpVerifyActions(ITestSettings settings)
        {
            this.TestPurpose("This test checks to see the behavior when do actions during core dump debugging.");
            this.WriteSettings(settings);

            this.Comment("Compile the application");
            CompileApp(this, settings, DebuggeeMonikers.CoreDump.Action);

            this.Comment("Set initial debuggee for application");
            IDebuggee debuggee = OpenDebuggee(this, settings, DebuggeeMonikers.CoreDump.Action);

            this.Comment("Launch the application to hit an exception and generate core dump");
            string coreDumpPath = GenerateCoreDump(settings, DebuggeeMonikers.CoreDump.Action, debuggee);

            using (IDebuggerRunner runner = CreateDebugAdapterRunner(settings))
            {
                this.Comment("Configure the core dump before start debugging");
                runner.LaunchCoreDump(settings.DebuggerSettings, debuggee, coreDumpPath);

                this.Comment("Start debugging to hit the exception and verify it should stop at correct source file and line");
                runner.Expects.StoppedEvent(StoppedReason.Exception, srcClassName, 8).AfterConfigurationDone();

                this.Comment("Verify the error message for relevant actions during core dump debugging");
                using (IThreadInspector threadInspector = runner.GetThreadInspector())
                {
                    this.Comment("Get current frame object");
                    IFrameInspector currentFrame = threadInspector.Stack.First();

                    this.Comment("Verify current frame when stop at the exception");
                    threadInspector.AssertStackFrameNames(true, "myException::RaisedUnhandledException.*");

                    this.Comment("Try to evaluate a expression and verify the results");

                    string varEvalResult = currentFrame.Evaluate("result + 1");
                    Assert.Equal("11", varEvalResult);

                    this.Comment("Try to evaluate a function and verify the error message");
                    EvaluateResponseValue evalResponse = runner.RunCommand(new EvaluateCommand("EvalFunc(100, 100)", currentFrame.Id));
                    // TODO: From VSCode IDE with the latest cpptools, the error message after evaluate function is "not availabe", but evalResponse.message is null, is it expected ?
                    // Currently just simply verify the result is empty as a workaround, need to revisit this once get more information from logged bug #242418
                    this.Comment(string.Format(CultureInfo.InvariantCulture, "Actual evaluated result: {0}", evalResponse.body.result));
                    Assert.True(evalResponse.body.result.Equals(string.Empty));

                    this.Comment(string.Format(CultureInfo.InvariantCulture, "Actual evaluated respone message: {0}", evalResponse.message));
                    //Assert.True(evalResponse.message.Contains(evalError));
                }

                this.Comment("Try to step in and verify the error message");
                StepInCommand stepInCommand = new StepInCommand(runner.DarRunner.CurrentThreadId);
                runner.RunCommandExpectFailure(stepInCommand);
                this.WriteLine(string.Format(CultureInfo.InvariantCulture, "Actual respone message: {0}", stepInCommand.Message));
                Assert.Contains(stepInCommand.Message, string.Format(CultureInfo.InvariantCulture, stepError, "step in"));

                this.Comment("Try to step over and verify the error message");
                StepOverCommand stepOverCommand = new StepOverCommand(runner.DarRunner.CurrentThreadId);
                runner.RunCommandExpectFailure(stepOverCommand);
                this.WriteLine(string.Format(CultureInfo.InvariantCulture, "Actual respone message: {0}", stepOverCommand.Message));
                Assert.Contains(stepOverCommand.Message, string.Format(CultureInfo.InvariantCulture, stepError, "step next"));

                this.Comment("Try to step out and verify the error message");
                StepOutCommand stepOutCommand = new StepOutCommand(runner.DarRunner.CurrentThreadId);
                runner.RunCommandExpectFailure(stepOutCommand);
                this.WriteLine(string.Format(CultureInfo.InvariantCulture, "Actual respone message: {0}", stepOutCommand.Message));
                Assert.Contains(stepOutCommand.Message, string.Format(CultureInfo.InvariantCulture, stepError, "step out"));

                this.Comment("Try to continue and verify the error message");
                ContinueCommand continueCommand = new ContinueCommand(runner.DarRunner.CurrentThreadId);
                runner.RunCommandExpectFailure(continueCommand);
                this.WriteLine(string.Format(CultureInfo.InvariantCulture, "Actual respone message: {0}", continueCommand.Message));
                Assert.Contains(continueCommand.Message, string.Format(CultureInfo.InvariantCulture, stepError, "continue"));

                this.Comment("Try to set a breakpoint and verify the error message");
                SourceBreakpoints           bp            = debuggee.Breakpoints(srcAppName, 16);
                SetBreakpointsResponseValue setBpResponse = runner.SetBreakpoints(bp);
                Assert.False(setBpResponse.body.breakpoints[0].verified);
                this.WriteLine(string.Format(CultureInfo.InvariantCulture, "Actual respone message: {0}", setBpResponse.body.breakpoints[0].message));
                Assert.Contains(setBpResponse.body.breakpoints[0].message, bpError);

                this.Comment("Stop core dump debugging");
                runner.DisconnectAndVerify();
            }
        }
示例#19
0
 public void Execute(ContinueCommand command)
 {
     ShouldContinue = true;
     ShouldStep     = false;
 }
 public void SelectDate(DateTime dateTime)
 {
     _dateTime = dateTime;
     ContinueCommand.RaiseCanExecuteChanged();
 }