HandleRightClick() public method

Handle a right click by popping up the implied context menu.
public HandleRightClick ( XCore.Mediator mediator, Control hostControl, bool shouldDisposeThisWhenClosed ) : bool
mediator XCore.Mediator
hostControl System.Windows.Forms.Control
shouldDisposeThisWhenClosed bool True, if the menu handler is to dispose of the CmObjectUi after menu closing
return bool
コード例 #1
0
		private bool HandleRightClickOnObject(int hvoDummy)
		{
			if (hvoDummy == 0)
				return false;

			if (m_realEnvs.ContainsKey(hvoDummy))
			{
				// This displays the "Show in Environments list" item in the popup menu, in
				// addition to all the Insert X" items.
				int hvo = m_realEnvs[hvoDummy].Hvo;
				ReferenceCollectionUi ui = new ReferenceCollectionUi(Cache, m_rootObj, m_rootFlid, hvo);
				return ui.HandleRightClick(Mediator, this, true);
			}
			else
			{
				// We need a CmObjectUi in order to call HandleRightClick().  This won't
				// display the "Show in Environments list" item in the popup menu.
				CmObjectUi ui = new CmObjectUi(m_rootObj);
				return ui.HandleRightClick(Mediator, this, true, "mnuEnvReferenceChoices");
			}
		}
コード例 #2
0
		private void ContextMenuRequested(object sender, ContextMenuRequestedEventArgs e)
		{
			e.Selection.Install();
			ICmObject obj = CurrentObject;

			if (obj != null)
			{
				// we only bother to display the context menu if an item is selected
				using (var ui = new CmObjectUi(obj))
				{
					e.Handled = ui.HandleRightClick(Mediator, this, true, ContextMenuID);
				}
			}
		}
コード例 #3
0
		public virtual bool DisplayContextMenu(IVwSelection vwselNew)
		{
			SelectionHelper sel = SelectionHelper.Create(vwselNew, m_view);
			int hvo = CurrentHvo;

			if (hvo != 0)
			{
				// we only bother to display the context menu if an item is selected
				CmObjectUi ui = new CmObjectUi(CmObject.CreateFromDBObject(m_cache, hvo));
				return ui.HandleRightClick(Mediator, this, true, m_menuId);
			}
			else
			{
				return false;
			}
		}
コード例 #4
0
		public virtual bool DisplayContextMenu(IVwSelection vwselNew)
		{
			SelectionHelper sel = SelectionHelper.Create(vwselNew, m_view);
			var obj = CurrentObject;

			if (obj != null)
			{
				// we only bother to display the context menu if an item is selected
				using (var ui = new CmObjectUi(obj))
					return ui.HandleRightClick(Mediator, this, true, ContextMenuID);
			}
			return false;
		}