Microsoft.ManagementConsole.FormView.ShowContextMenu C# (CSharp) Method

ShowContextMenu() public method

public ShowContextMenu ( Point point, bool onResultItem ) : void
point Point
onResultItem bool
return void
        public void ShowContextMenu(Point point, bool onResultItem)
        {
            base.ThrowIfShutdown("ShowContextMenu");
            if (!base.Initialized || !base.Visible)
            {
                TraceSources.ExecutiveSource.TraceEvent(TraceEventType.Warning, 12, "Ignoring context menu request since view hasn't been initialized or is hidden.");
            }
            else
            {
                if (onResultItem && (base.SelectionData.SelectionCardinality == SelectionCardinality.None))
                {
                    throw new InvalidOperationException(Microsoft.ManagementConsole.Internal.Utility.LoadResourceString(Microsoft.ManagementConsole.Internal.Strings.FormViewShowContextMenuNoSelection));
                }
                ShowContextMenuCommand command = new ShowContextMenuCommand();
                command.ViewInstanceId = base.ViewInstanceId;
                command.Point = point;
                command.OnResultItem = onResultItem;
                ISnapInPlatform snapInPlatform = base.SnapIn.SnapInPlatform;
                if (snapInPlatform == null)
                {
                    throw new InvalidOperationException(Microsoft.ManagementConsole.Internal.Utility.LoadResourceString(Microsoft.ManagementConsole.Internal.Strings.ExceptionCommonSnapInPlatformIsNull));
                }
                snapInPlatform.ProcessCommand(command);
            }
        }