Handler.Update C# (CSharp) Method

Update() private method

private Update ( ) : void
return void
    private void Update()
    {
        if (TouchChecker.WasTappingFromCollider(Camera.main, myCollider, true))
        {
            if (GameManager.Instance.IsEveryTotemOnLauncher) {
                animator.SetTrigger ("Start");
                GameManagerForStates.Play ();
            }
            else
            {
                mainCamera = Camera.main;
                cameraManager = mainCamera.gameObject.GetComponent<CameraManager>();
                cameraManager.enabled = false;
                mainCamera.DOShakePosition (duration, strenght, vibrato).OnComplete(OnShakeComplete);
                animator.SetTrigger ("Break");
            }
           }
    }

Usage Example

        private void buttonSubmit_Click(object sender, EventArgs e)
        {
            if (this.isValidData())
            {
                Handler h = new Handler();

                //Create new Lecturer object
                Lecturer lecturer = new Lecturer(textBoxID.Text, textBoxFirstName_.Text, textBoxLastName_.Text, textBoxAddress.Text, textBoxEmail.Text, textBoxTel.Text, dateTimePicker_.Value, textBoxLogin.Text, textBoxPassword.Text, comboBoxDepartment.Text, comboBoxDegree_.Text, Int32.Parse(textBoxHoursPerWeek.Text != "" ? textBoxHoursPerWeek.Text : "0"));

                if (lecturer != null)
                {
                    //Insert into DataBase Lecturer table
                    if (h.Update <Lecturer>(lecturer))
                    {
                        if (this.parent != null)
                        {
                            this.parent.RefreshDataSource();
                        }
                        MessageBox.Show("Lecturer " + lecturer.FirstName + " " + lecturer.LastName + " was successful updated.");
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("An error accrued when updating this lecturer, please try again.");
                    }
                }
            }
        }
All Usage Examples Of Handler::Update