示例#1
0
        private void Update()
        {
            if (Input.GetMouseButtonDown(0))
            {
                MainAction?.Invoke();
            }

            if (Input.GetKeyDown(KeyCode.Escape))
            {
                Escape?.Invoke();
            }

            if (Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.KeypadEnter))
            {
                InteractAction?.Invoke();
            }

            if (Input.GetKeyDown(KeyCode.Alpha1))
            {
                SetActiveSlot?.Invoke(1);
            }

            if (Input.GetKeyDown(KeyCode.Alpha2))
            {
                SetActiveSlot?.Invoke(2);
            }

            if (Input.GetKeyDown(KeyCode.BackQuote))
            {
                ToggleAnimVisibility?.Invoke();
            }
        }
示例#2
0
 private void Jitting()
 {
     SetupAction?.Invoke();
     MainAction.Invoke(1);
     IdleAction.Invoke(1);
     CleanupAction?.Invoke();
 }
示例#3
0
 public void Jitting()
 {
     // first signal about jitting is raised from auto-generated Program.cs, look at BenchmarkProgram.txt
     MainAction.Invoke(1);
     IdleAction.Invoke(1);
     isJitted = true;
 }
示例#4
0
        public bool DoActionTransacted()
        {
            bool             isSuccess   = false;
            TransactionScope transaction = null;

            try
            {
                transaction = new TransactionScope();
                Inforamtion = Transaction.Current.TransactionInformation;
                AttachEventHandler();
                MainAction.Invoke();
            }
            catch (Exception e)
            {
                Transaction.Current.Rollback();
            }
            finally
            {
                if (Transaction.Current != null &&
                    Transaction.Current.TransactionInformation.Status != TransactionStatus.Aborted)
                {
                    transaction.Complete();
                    transaction.Dispose();
                    transaction = null;
                    isSuccess   = true;
                }
            }
            return(isSuccess);
        }
示例#5
0
 public void RunAndWait()
 {
     this.EventResult = MainAction?.Invoke(this);
     this.ExcuteDate  = DateTime.Now;
     this.IsExcuted   = true;
 }