/// <summary> /// Tears down a crop control. /// </summary> /// <param name="rotateControl">The photo crop control.</param> private void TearDownRotateControl(RotatePhotoControl rotateControl) { rotateControl.ContinueEvent -= this.ContinueRotate; rotateControl.CancelEvent -= this.CancelRotate; rotateControl.Hide(); rotateControl.Dispose(); this.EditTableLayoutPanel.Show(); }
/// <summary> /// handles the click event of the Rotate button /// </summary> /// <param name="sender">The sender</param> /// <param name="e">The <see cref="System.EventArgs"/> intance containing the event data</param> /// <remarks> Authors: Thomas Donnellan and Miguel Gonzales</remarks> private void HandleRotateButtonClick(object sender, EventArgs e) { this.SuspendLayout(); this.EditTableLayoutPanel.Hide(); var rotateControl = new RotatePhotoControl(); rotateControl.Image = (Image)this.photoCropBox.Photo.Clone(); rotateControl.OriginalPhoto = this.photoCropBox.Photo; rotateControl.CancelEvent += this.CancelRotate; rotateControl.ContinueEvent += this.ContinueRotate; this.Controls.Add(rotateControl); rotateControl.Dock = DockStyle.Fill; rotateControl.Show(); this.ResumeLayout(); }