Exemplo n.º 1
0
        public event EventHandler EventReset = null;  // Событие, которое происходит в момент нажатия на кнопку Reset


        // Метод-обработчик события Tick, которое реализует функционал запуска, остановки, обнуления счета таймера
        private void Timer_Tick(object sender, EventArgs e)
        {
            if (sender.GetType().Name != "DispatcherTimer")
            {
                myobject = ((Button)sender).Name;
            }
            switch (myobject) // Проверка на нажатую кнопку
            {
            case "Start":
            {
                timer.Start();          // Метод, который запускает таймер (запускает System.Windows.Threading.DispatcherTimer)
                EventStart.Invoke(sender, e);
                break;
            }

            case "Stop":
            {
                timer.Stop();          // Метод, который останавливает таймер (запускает System.Windows.Threading.DispatcherTimer)
                break;
            }

            case "Reset":
            {
                timer.Stop();
                EventReset.Invoke(sender, e);
                break;
            }

            default:
            {
                timer.Stop();
                break;
            }
            }
        }
Exemplo n.º 2
0
 public void Dispose()
 {
     EventAwake.Dispose();
     EventFixedUpdate.Dispose();
     EventLateUpdate.Dispose();
     EventOnAnimatorIK.Dispose();
     EventOnAnimatorMove.Dispose();
     EventOnApplicationFocus.Dispose();
     EventOnApplicationPause.Dispose();
     EventOnApplicationQuit.Dispose();
     EventOnAudioFilterRead.Dispose();
     EventOnBecameInvisible.Dispose();
     EventOnBecameVisible.Dispose();
     EventOnCollisionEnter.Dispose();
     EventOnCollisionEnter2D.Dispose();
     EventOnCollisionExit.Dispose();
     EventOnCollisionExit2D.Dispose();
     EventOnCollisionStay.Dispose();
     EventOnCollisionStay2D.Dispose();
     EventOnJointBreak.Dispose();
     EventOnJointBreak2D.Dispose();
     EventOnControllerColliderHit.Dispose();
     EventOnConnectedToServer.Dispose();
     EventOnDisconnectedFromServer.Dispose();
     EventOnMasterServerEvent.Dispose();
     EventOnFailedToConnect.Dispose();
     EventOnFailedToConnectToMasterServer.Dispose();
     EventOnDestroy.Dispose();
     EventOnDisable.Dispose();
     EventOnEnable.Dispose();
     EventOnDrawGizmos.Dispose();
     EventOnDrawGizmosSelected.Dispose();
     EventOnGUI.Dispose();
     EventOnMouseDown.Dispose();
     EventOnMouseDrag.Dispose();
     EventOnMouseEnter.Dispose();
     EventOnMouseExit.Dispose();
     EventOnMouseOver.Dispose();
     EventOnMouseUp.Dispose();
     EventOnMouseUpAsButton.Dispose();
     EventOnNetworkInstantiate.Dispose();
     EventOnParticleCollision.Dispose();
     EventOnParticleTrigger.Dispose();
     EventOnPlayerConnected.Dispose();
     EventOnPlayerDisconnected.Dispose();
     EventOnPostRender.Dispose();
     EventOnPreCull.Dispose();
     EventOnPreRender.Dispose();
     EventOnRenderImage.Dispose();
     EventOnRenderObject.Dispose();
     EventOnSerializeNetworkView.Dispose();
     EventOnServerInitialized.Dispose();
     EventOnTransformChildrenChanged.Dispose();
     EventOnTransformParentChanged.Dispose();
     EventOnTriggerEnter.Dispose();
     EventOnTriggerEnter2D.Dispose();
     EventOnTriggerExit.Dispose();
     EventOnTriggerExit2D.Dispose();
     EventOnTriggerStay.Dispose();
     EventOnTriggerStay2D.Dispose();
     EventOnWillRenderObject.Dispose();
     EventReset.Dispose();
     EventStart.Dispose();
     EventUpdate.Dispose();
 }