// private void HandleKeyPress (Object sender, KeyPressEventArgs e) // { // var keys = config.Navigation; // // // The keypressed method uses the KeyChar property to check // // whether the ENTER key is pressed. // // // If the ENTER key is pressed, the Handled property is set to true, // // to indicate the event is handled. // if (e.KeyChar == keys.PreviousImage) { // imageBrowser.PreviousImage (); // e.Handled = true; // } else if (e.KeyChar == keys.NextImage) { // imageBrowser.NextImage (); // e.Handled = true; // } else if (e.KeyChar == keys.PreviousPage) { // imageBrowser.PreviousPage (); // e.Handled = true; // } else if (e.KeyChar == keys.NextPage) { // imageBrowser.NextPage (); // e.Handled = true; // } // } void HandleImage1Click(object sender, ImageClickEventArgs e) { if (e != null && e.Information != null && !String.IsNullOrEmpty (e.Information.Path)) { mainImage.Load (e.Information.Path); } else if (e != null && e.Thumbnail != null) { mainImage.Image = e.Thumbnail; } }
// The method which fires the Event protected void OnImageClick(object sender, EventArgs ignored) { var pictureBox = (PictureBox)sender; CurrentPictureBox = pictureBox; updateOverview(); var data = new ImageClickEventArgs (pictureBox.Image, pictureBox.Image.Tag as ImageInformation); // Check if there are any Subscribers if (ImageClick != null) { // Call the Event ImageClick (this, data); } }