/// <summary> /// Invoked by a slice when the user does something to bring up a context menu /// </summary> public void OnShowContextMenu(object sender, TreeNodeEventArgs e) { CheckDisposed(); //just pass this onto, for example, the XWorks View that owns us, //assuming that it has subscribed to this event on this object. //If it has not, then this will still point to the "auto menu handler" Debug.Assert(ShowContextMenuEvent != null, "this should always be set to something"); CurrentSlice = e.Slice; SliceMenuRequestArgs args = new SliceMenuRequestArgs(e.Slice, false); ShowContextMenuEvent(sender, args); // ContextMenu menu = ShowContextMenuEvent(sender, args); // menu.Show(e.Context, e.Location); }
public void OnShowContextMenu(object sender, TreeNodeEventArgs e) { CheckDisposed(); //just pass this onto, for example, the XWorks View that owns us, //assuming that it has subscribed to this event on this object. //If it has not, then this will still point to the "auto menu handler" Debug.Assert(ShowContextMenuEvent != null, "this should always be set to something"); CurrentSlice = e.Slice; var args = new SliceMenuRequestArgs(e.Slice, false); // TODO: ShowContextMenuEvent returns a ContextMenu that we should dispose. However, // we can't do that right here (because that destroys the menu before being shown). // Ideally we would store the context menu in a member variable and dispose this later // on. However, it is unlikely that not disposing this context menu will cause any // problems, so we leave it as is for now. ShowContextMenuEvent(sender, args); // ContextMenu menu = ShowContextMenuEvent(sender, args); // menu.Show(e.Context, e.Location); }