/// <summary> /// Event received when context menu of the form is open /// </summary> /// <param name="sender">sender of the event</param> /// <param name="e">event args</param> private void OnDockerShowContextMenu(object sender, FormContextMenuEventArgs e) { EventHandler <FormContextMenuEventArgs> handler = ShowContextMenu; if (handler != null) { handler(this, e); } }
/// <summary> /// Occurs when pages context menu button was clicked /// </summary> /// <param name="sender">sender of the event</param> /// <param name="e">event arguments</param> private void OnViewContextMenuClick(object sender, FormEventArgs e) { EventHandler <FormContextMenuEventArgs> handler = ShowContextMenu; if (handler != null) { Point menuLocation = Control.MousePosition; menuLocation = e.Form.PointToClient(menuLocation); menuLocation.Y = 0; FormContextMenuEventArgs args = new FormContextMenuEventArgs(menuLocation, e.Form, e.FormId); handler(this, args); } }