protected override bool OnNeedShowContextMenu( NativeMethods.ContextMenuKind contextMenuKind, Point position, NativeMethods.IUnknown queryForStatus, NativeMethods.IDispatch objectAtScreenCoordinates) { //if (!EverInitialized) return true; base.OnNeedShowContextMenu(contextMenuKind, position, queryForStatus, objectAtScreenCoordinates); if (!DesignMode && !HtmlEditorDesignModeManager.IsDesignMode) { if (Configuration?.ExternalInformationProvider != null) { var font = Configuration.ExternalInformationProvider.Font; contextMenuStrip.Font = font ?? Font; if (Configuration.ExternalInformationProvider.ForeColor.HasValue) { contextMenuStrip.ForeColor = Configuration.ExternalInformationProvider.ForeColor.Value; } } else { contextMenuStrip.Font = Font; } contextMenuStrip.Show(position); } return(true); }
protected virtual bool OnNeedShowContextMenu( NativeMethods.ContextMenuKind contextMenuKind, Point position, NativeMethods.IUnknown queryForStatus, NativeMethods.IDispatch objectAtScreenCoordinates) { return(true); }
private void ChangeInstallAllUsersUI(IVsdDialogModule uiModule) { int hr = VSConstants.S_OK; NativeMethods.IDispatch properties = (NativeMethods.IDispatch)uiModule.DynamicProperties; Guid guid = Guid.Empty; string[] names = new string[] { "InstallAllUsersVisible" }; int[] dispIds = new int[] { 0 }; hr = properties.GetIDsOfNames(ref guid, names, names.Length, 0, dispIds); if (dispIds[0] != -1) { ComTypes.DISPPARAMS[] dispParams = new ComTypes.DISPPARAMS[1]; dispParams[0].cNamedArgs = 0; dispParams[0].rgdispidNamedArgs = IntPtr.Zero; dispParams[0].cArgs = 1; dispParams[0].rgvarg = Marshal.AllocCoTaskMem(0x1000); try { Marshal.GetNativeVariantForObject(!InstallAllUsers, dispParams[0].rgvarg); hr = properties.Invoke( dispIds[0], ref guid, CultureInfo.CurrentCulture.LCID, (short)ComTypes.INVOKEKIND.INVOKE_PROPERTYPUT, dispParams, null, null, null); } finally { Marshal.FreeCoTaskMem(dispParams[0].rgvarg); dispParams[0].rgvarg = IntPtr.Zero; if (hr != VSConstants.S_OK) { Marshal.ThrowExceptionForHR(hr); } } } }
protected override bool OnNeedShowContextMenu( NativeMethods.ContextMenuKind contextMenuKind, Point position, NativeMethods.IUnknown queryForStatus, NativeMethods.IDispatch objectAtScreenCoordinates) { base.OnNeedShowContextMenu(contextMenuKind, position, queryForStatus, objectAtScreenCoordinates); if (_configuration != null && _configuration.ExternalInformationProvider != null) { var font = _configuration.ExternalInformationProvider.Font; contextMenuStrip.Font = font ?? Font; } else { contextMenuStrip.Font = Font; } contextMenuStrip.Show(position); return(true); }