Example #1
0
        public async void RunTrial()
        {
            TrialStart?.Invoke(this, _TrialLoop.CurrentIteration);
            _Status = StatusType.TrialDelay;
            try
            {
                await TrialDelay.RunAsync(CancelToken);

                if (!CancelToken.IsCancellationRequested)
                {
                    CurrentState = StartState;
                    ScriptMachineEventArgs e = new ScriptMachineEventArgs(StartState);
                    ScriptStart?.Invoke(this, e);
                    _MazeDataPoint         = new MazeDataPoint(CurrentState.Name);
                    _MazeDataPoint.Session = _SessionLoop.CurrentIteration;
                    _MazeDataPoint.Trial   = _TrialLoop.CurrentIteration;
                    DataPointReady?.Invoke(this, _MazeDataPoint);
                    CurrentState.Activate();
                    _Status    = StatusType.Running;
                    _StartTime = DateTime.Now;
                }
                else
                {
                    TrialAborted?.Invoke(this, new EventArgs());
                }
            }
            catch (Exception ex)
            {
                TrialAborted?.Invoke(this, new EventArgs());
            }
        }
Example #2
0
        private void btn2_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.MessageBoxResult result = MessageBox.Show("Ouverture de TeamViewer", "TeamViewer",
                                                                     MessageBoxButton.OK, MessageBoxImage.Exclamation);
            ScriptStart sStart = new ScriptStart();

            sStart.invoke();


            // do something
        }
Example #3
0
 private void ScriptFSM_ScriptStart(object sender, ScriptMachineEventArgs e)
 {
     ScriptStart?.Invoke(this, e);
 }