/// <summary> /// Fires a RotationEvent to notify the main form that the image has been rotated. /// </summary> /// <param name="originalOrientation">The original (pre-rotation) orientation. </param> /// <param name="newOrientation">The new orientation. </param> private void FireRotationEvent(Orientation originalOrientation, Orientation newOrientation) { if (this.RotationEvent != null) { RotationEventArgs rotationEventArgs = new RotationEventArgs(originalOrientation, newOrientation); this.RotationEvent(this, rotationEventArgs); } }
/// <summary> /// Activated when an image is rotated on one of the DualImagePanel instances on the form. /// Updates our count of rotated images, updates the status bar text, and updates the state /// of UI elements on the form. /// </summary> /// <param name="sender">Unused. </param> /// <param name="e">The details of the rotation that was performed. </param> private void innerPanel_RotationEvent(object sender, RotationEventArgs e) { if (e.NewOrientation == Orientation.Initial) { //We just rotated *from* upright orientation, so there's now one more rotated //image on the form. this._rotatedImageCount--; UpdateStatusText(); UpdateUIElements(); } else if (e.OriginalOrientation == Orientation.Initial) { //We just rotated *to* upright orientation, so there's no one less rotated //image on the form. this._rotatedImageCount++; UpdateStatusText(); UpdateUIElements(); } }