Skip to content

Commit

Permalink
Added KryptonMenuImageSelect click event
Browse files Browse the repository at this point in the history
Useful in the condtionnal formatting menu of KryptonOutlookGrid
  • Loading branch information
Cocotteseb committed Dec 5, 2015
1 parent 621ab7c commit ef4a415
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ public class KryptonContextMenuImageSelect : KryptonContextMenuItemBase
[Category("Action")]
[Description("Occurs when user is tracking over an image.")]
public event EventHandler<ImageSelectEventArgs> TrackingImage;

/// <summary>
/// Occurs when the value of the SelectedIndex property changes.
/// </summary>
[Category("Action")]
[Description("Occurs when an image is clicked.")]
public event EventHandler Click;

#endregion

#region Identity
Expand Down Expand Up @@ -340,6 +348,18 @@ protected virtual void OnTrackingImage(ImageSelectEventArgs e)
if (TrackingImage != null)
TrackingImage(this, e);
}

/// <summary>
/// Raises the Click event.
/// </summary>
/// <param name="e">An EventArgs that contains the event data.</param>
internal virtual void OnClick(EventArgs e)
{
if (Click != null)
Click(this, e);
}


#endregion

#region Internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ private void OnItemClick(object sender, MouseEventArgs e)
// Set new selection index
_imageSelect.SelectedIndex = _imageIndex;

//Fire a click item event : seb the right way ?? after selected index
_imageSelect.OnClick(e);

// Should we automatically try and close the context menu stack
if (_imageSelect.AutoClose)
{
Expand Down

0 comments on commit ef4a415

Please sign in to comment.