private void Controller_OnShowContextMenu(object sender, EntityMenuEventArgs e) { IShape shape = this.graphVisualizationInfoView.Controller.Model.GetShapeAt(e.MouseEventArgs.Location); if (shape != null) { IShapeInfo shapeInfo = shape.Tag as IShapeInfo; this.shapeContextMenu.Tag = shapeInfo; PointF worldPoint = this.graphVisualizationInfoView.Controller.View.WorldToView(e.MouseEventArgs.Location); this.shapeContextMenu.Show(this, Point.Round(worldPoint)); } }
/// <summary> /// Raises the OnShowContextMenu event /// </summary> /// <param name="e"></param> public void RaiseOnShowContextMenu(EntityMenuEventArgs e) { EventHandler<EntityMenuEventArgs> handler = OnShowContextMenu; if(handler != null) { handler(this, e); } }
/// <summary> /// Handles the OnShowContextMenu event of the Controller control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:Netron.Diagramming.Core.EntityMenuEventArgs"/> instance containing the event data.</param> void Controller_OnShowContextMenu(object sender, EntityMenuEventArgs e) { menu.Show(this, e.MouseEventArgs.Location); }