Beispiel #1
0
 private void OnTriggerExit(Collider other)
 {
     if (IsActivePlayer(other))
     {
         OnExit.Invoke();
     }
 }
Beispiel #2
0
        private void RunOnBackground()
        {
            lock (this)
            {
                _isRunning = true;
            }

            OnStart?.Invoke();

            try
            {
                DoWork?.Invoke();
            }
            catch (Exception ex)
            {
                OnError?.Invoke(ex);
            }
            finally
            {
                OnExit?.Invoke();

                lock (this)
                {
                    _isRunning = false;
                }
            }
        }
Beispiel #3
0
 private void OnTriggerExit2D(Collider2D obj)
 {
     if (obj.tag == "Ball")
     {
         OnExit?.Invoke();
     }
 }
Beispiel #4
0
 public void OnExitBackClicked()
 {
     audioM.Click(); // hello
     OnExit?.Invoke(this, new ExitArgs {
         action = WindowAction.Close
     });
 }
 private void InvokeOnExit(object sender = null, EventArgs e = null)
 {
     if (OnExit != null)
     {
         OnExit.Invoke(this, new EventArgs());
     }
 }
Beispiel #6
0
        /// <summary>
        /// Goes to the previous Menu Item
        /// </summary>
        /// <returns>The new page</returns>
        public Menu GoBack()
        {
            // Trigger exit if nothing exists
            IMenuNavigationHook currentPage = Peek();

            if (currentPage == null)
            {
                OnExit?.Invoke(this, new object());
                return(null);
            }

            // Unload the Previous Menu
            currentPage.InvokeOnNavigatingFrom(this, new object());
            currentPage = m_backStack.Pop();
            currentPage.InvokeOnUnloaded(this, new object());

            // Resume the previous page
            IMenuNavigationHook newPage = Peek();

            if (newPage == null)
            {
                OnExit?.Invoke(this, new object());
                return(null);
            }
            newPage?.InvokeOnNavigatingTo(this, new object());
            newPage?.InvokeOnNavigated(this, new object());
            newPage?.InvokeOnLoaded(this, new object());

            // Return the new menu
            return(newPage as Menu);
        }
Beispiel #7
0
 public ConsoleProcess(string cmd, string[] args, bool relativeToAssemblyDir = true, OnExit onExit = null, OnOutput onOutput = null, OnError onError = null)
 {
     if (!File.Exists(cmd))
     {
         Error("The executable {0} could not be found.", cmd);
         return;
     }
     Process           = new Process();
     Cmd               = relativeToAssemblyDir ? Path.Combine(AssemblyDirectory.FullName, cmd) : cmd;
     Args              = args;
     OnExit            = onExit;
     OnOutput          = onOutput;
     OnError           = onError;
     Process.StartInfo = new ProcessStartInfo(cmd, string.Join(" ", args))
     {
         UseShellExecute        = false,
         RedirectStandardError  = true,
         RedirectStandardInput  = false,
         RedirectStandardOutput = true
     };
     Process.EnableRaisingEvents = true;
     Process.OutputDataReceived += Process_OutputDataReceived;
     Process.ErrorDataReceived  += Process_ErrorDataReceived;
     Process.Exited   += Process_Exited;
     Process.Disposed += Process_Disposed;
     Initialized       = true;
 }
        public override bool ProcessKey(KeyEvent keyEvent)
        {
            if (keyEvent.Key != Key.Enter)
            {
                return(_filesView.ProcessKey(keyEvent));
            }

            var selectedItem = _fileViewSource[_filesView.SelectedItem];

            if (selectedItem.IsDirectory)
            {
                _currentPath = selectedItem.GoToFile();
                _currentDirectoryText.Text = _currentPath;
                _fileViewSource            = GetListViewSource();
                _filesView.SetSource(_fileViewSource);
            }

            else
            {
                AppController.GetLogger()
                .Info(
                    $"File {selectedItem.ParentDirectory}{Path.DirectorySeparatorChar}{selectedItem.FileName} was selected.");

                OnExit?.Invoke(selectedItem);
            }

            return(true);
        }
Beispiel #9
0
 protected virtual void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.gameObject == player)
     {
         OnExit?.Invoke();
     }
 }
Beispiel #10
0
        public void Run()
        {
            OnStart?.Invoke(this, EventArgs.Empty);

            var windowSettings = _config.WindowSettings;

            if (windowSettings == null)
            {
                throw new Exception("Window settings option is null");
            }

            _window = new MainWindow(windowSettings);
            MainWindowUtils.Initialize(_window);
            _window.Closed += (sender, args) => { ShouldExit = true; };
            _window.Run();

            var eventArgs = new EventArgs();

            while (!ShouldExit)
            {
                MainLoop?.Invoke(this, eventArgs);
            }

            OnExit?.Invoke(this, EventArgs.Empty);
        }
Beispiel #11
0
 public void ExitBase()
 {
     SetState = null;
     m_GameStore.StoreDidUpdate -= StoreDidUpdate;
     Exit();
     OnExit?.Invoke(this, EventArgs.Empty);
 }
Beispiel #12
0
        private void SetContextMenu(bool isShutDownInProgress)
        {
            var cm = new ContextMenu();

            var openMi = new MenuItem();

            openMi.Text   = "Open";
            openMi.Click += (s, e) => { OnOpen?.Invoke(); };
            cm.MenuItems.Add(openMi);

            if (isShutDownInProgress)
            {
                var cancelMi = new MenuItem();
                cancelMi.Text   = "Cancel delayed operation";
                cancelMi.Click += (s, e) => { OnCancel?.Invoke(); };
                cm.MenuItems.Add(1, cancelMi);
            }

            var closeMi = new MenuItem();

            closeMi.Text   = "Exit";
            closeMi.Click += (s, e) => { OnExit?.Invoke(); };
            cm.MenuItems.Add(closeMi);

            if (_ni.ContextMenu != null)
            {
                _ni.ContextMenu.Dispose();
            }
            _ni.ContextMenu = cm;
        }
Beispiel #13
0
 /*
  * It's button func on ExitButton
  */
 public void OnExitClicked()
 {
     audioM.Click();
     OnExit?.Invoke(this, new ExitArgs {
         action = WindowAction.Open, qNum = currentQuestionNum
     });
 }
 protected override void OnExiting(object sender, EventArgs args)
 {
     OnPreExit.Raise(this, args);
     OnExit.Raise(this, args);
     base.OnExiting(sender, args);
     OnPostExit.Raise(this, args);
 }
Beispiel #15
0
        public OnExit ReadStateOnExit()
        {
            OnExit evt = new OnExit();

            ReadExecutable(evt);
            return(evt);
        }
Beispiel #16
0
 /// <summary>
 /// 离开
 /// </summary>
 public virtual void OnDistanceExit(DistanceInteraction distanceInteraction)
 {
     if (OnExit != null)
     {
         OnExit.Invoke(distanceInteraction);
     }
 }
Beispiel #17
0
 private void OnMouseExit()
 {
     if (!_isMoving)
     {
         OnExit?.Invoke(this, EventArgs.Empty);
     }
 }
 private void OnTriggerExit(Collider other)
 {
     print("DeToggled"); if (OnEnterAndExit)
     {
         OnExit.Invoke();
     }
 }
Beispiel #19
0
        private static async void Connect()
        {
            var client = new Client();

            client.Handler = HandleSignal;

            await client.Initialize(Config.UserId.ToString());

            var retry      = 0;
            var resetTimer = new Timer(10000);

            resetTimer.Elapsed += (s, e) => retry = 0;

            IsRunning = true;
            OnConnect?.Invoke();
            while (!await client.Start() && retry < 3)
            {
                if (retry > 0)
                {
                    resetTimer.Stop();
                }
                retry++;
                resetTimer.Start();
            }
            IsRunning = false;
            OnExit?.Invoke();
        }
 void OnTriggerExit(Collider other)
 {
     if (0 != (layers.value & 1 << other.gameObject.layer))
     {
         OnExit.Invoke();
     }
 }
 void OnTriggerExit2D(Collider2D col)
 {
     if (col.gameObject.Equals(player))
     {
         OnExit.Invoke(col);
     }
 }
 public virtual Dictionary <string, object> Exit(IState to)
 {
     Debug.Log("EXIT de..." + this.Name);
     OnExit?.Invoke(this, to);
     HasStarted = false;
     return(null);
 }
Beispiel #23
0
        /// <summary>
        /// Запуск процесса закачки
        /// </summary>
        public void Start(decimal sessNo)
        {
            ProcessStartInfo psi = new ProcessStartInfo
            {
                Arguments = $"ETLApp.dll {sessNo} -h",
                FileName  = "dotnet",
                RedirectStandardOutput = true,
                UseShellExecute        = false,
                WorkingDirectory       = AppDomain.CurrentDomain.BaseDirectory
            };

            prc       = Process.Start(psi);
            ProcessID = prc.Id;
            prc.EnableRaisingEvents = true;

            Logger.WriteToTrace($"Процесс закачки \"{ProgramID}\" ({ProcessID}) запущен.");
            IsExecuting = true;

            // Событие запуска
            OnStart?.Invoke(this, EventArgs.Empty);

            prc.Exited += (s, a) => {
                Logger.WriteToTrace($"Процесс закачки \"{ProgramID}\" ({ProcessID}) завершён.");
                // Обновляем статус после окончания закачки
                LastStatus  = GetStatus(sessNo);
                IsExecuting = false;

                OnExit?.Invoke(this, a);
                // После завершения процесса очищаем все обработчики
                OnStart?.GetInvocationList().ToList().ForEach(d => OnStart -= (StartEventHandler)d);
                OnExit?.GetInvocationList().ToList().ForEach(d => OnExit   -= (ExitEventHandler)d);
            };
        }
Beispiel #24
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (!ZoneEnabled)
     {
         return;
     }
     OnExit?.Invoke(collision.gameObject);
 }
 private void Update()
 {
     if (GlobalInputManager.instance.GetButtonDown(0, Action.Cancel))
     {
         OnExit?.Invoke();
         gameObject.SetActive(false);
     }
 }
Beispiel #26
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (singleUse)
     {
         return;
     }
     OnExit.Invoke();
 }
 // cleans up and sets m_CanExecuteButtons to false
 protected override void ExecuteOnExit(Collider2D other)
 {
     m_InZone              = false;
     m_InputController     = null;
     m_InteractingCollider = null;
     OnExit.Invoke();
     Debug.Log("[" + other.gameObject.name + "] has left [" + name + "]");
 }
Beispiel #28
0
 void OnTriggerExit(Collider other)//触发器停止时执行
 {
     if (0 != (layers.value & 1 << other.gameObject.layer))
     //如果图层的属性与1右移这个位数之后的结果不为0
     {
         OnExit.Invoke();//在OE里调用这个other碰撞器
     }
 }
Beispiel #29
0
        /// <summary>
        /// Exits the application.
        /// </summary>
        public static void Exit()
        {
            is_exiting = true;

            OnExit?.Invoke(null, EventArgs.Empty);

            _mainLoopCancellationTokenSource?.Cancel();
        }
Beispiel #30
0
 public override void Exit()
 {
     m_alreadySelect = false;
     if (OnExit != null)
     {
         OnExit.Invoke();
     }
 }
 public Emailer(OnExit onExitCallback)
 {
     this.onExitCallback = onExitCallback;
 }