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);
}
}