/// <summary> /// ウェブブラウザの設定操作の実行 /// </summary> /// <param name="cmdId">コマンドID</param> /// <param name="cmdExecOpt">コマンド実行オプション</param> /// <param name="param">設定パラメータ</param> private void ExecWB(OLECMDID cmdId, OLECMDEXECOPT cmdExecOpt, object param) { object pvaIn = param; object pvaOut = Type.Missing; this.webBrowser.ExecWB(cmdId, cmdExecOpt, ref pvaIn, ref pvaOut); }
private int WBOleCommandExec(OLECMDID command, OLECMDEXECOPT cmdopt) { //Execute the command using default group NULL int hr = Hresults.S_FALSE; if (m_WBOleCommandTarget != null) { hr = m_WBOleCommandTarget.Exec(m_NullPointer, (uint)command, (uint)cmdopt, m_NullPointer, m_NullPointer); } return hr; }
public virtual void ExecWB (OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, ref object pvaIn, out object pvaOut);
public void ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, ref object pvaIn, ref object pvaOut) { throw new NotImplementedException(); }
public virtual void ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, [System.Runtime.InteropServices.Optional()] ref object pvaIn, [System.Runtime.InteropServices.Optional()] ref object pvaOut) { if ((this.ocx == null)) { throw new System.Windows.Forms.AxHost.InvalidActiveXStateException("ExecWB", System.Windows.Forms.AxHost.ActiveXInvokeKind.MethodInvoke); } this.ocx.ExecWB(cmdID, cmdexecopt, ref pvaIn, ref pvaOut); }
public void ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, ref object pvaIn, ref object pvaOut) { _EmbeddedWebBrowserAsIWebBrowser2.ExecWB(cmdID, cmdexecopt, ref pvaIn, ref pvaOut); }
public virtual void ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, ref object pvaIn, out object pvaOut);
public HRESULT ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) { return(((delegate * unmanaged <IWebBrowser2 *, OLECMDID, OLECMDEXECOPT, VARIANT *, VARIANT *, int>)(lpVtbl[54]))((IWebBrowser2 *)Unsafe.AsPointer(ref this), cmdID, cmdexecopt, pvaIn, pvaOut)); }
public void ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, ref object pvaIn, ref object pvaOut) { throw new NotImplementedException(); }
public override void Invoke(object inArg, IntPtr outArg, OLECMDEXECOPT options) { // getting the current value if (outArg != IntPtr.Zero) { var text = _envSwitchMgr.CurrentFactory?.Configuration.Description ?? string.Empty; Marshal.GetNativeVariantForObject(text, outArg); } // setting the current value if (inArg != null) { var text = inArg as string; var factory = _envSwitchMgr.AllFactories.SingleOrDefault(f => f.Configuration.Description == text); if (factory != null) { SwitchToFactoryAsync(factory).HandleAllExceptions(_serviceProvider, GetType()).DoNotWait(); } else { // The special "Add Environment..." entry, or any entry that no longer exists brings up the add dialog AddEnvironmentCommand .AddEnvironmentAsync(_envSwitchMgr, _serviceProvider, AddEnvironmentDialog.PageKind.VirtualEnvironment) .HandleAllExceptions(_serviceProvider, GetType()) .DoNotWait(); } } }
public void Exec(Guid pguidCmdGroup, uint nCmdID, OLECMDEXECOPT nCmdexecopt, ref object pvaIn, ref object pvaOut) { if (nCmdID == 0) { using (Process p = Process.GetCurrentProcess()) pvaOut = p.Id; } else if (nCmdID == 1) { // WinLive 198331 // We could be on an MTA thread at this point, but action here involves writer UI // and we need an STA compliant thread for it. We will spin up a new thread here // which is explicitly set to STA and launch our action through it. LaunchActionThreadWithState launchAction = new LaunchActionThreadWithState(_action, pvaIn as string[]); Thread staThread = new Thread(new ThreadStart(launchAction.ThreadProc)); // Set to STA model staThread.SetApartmentState(ApartmentState.STA); staThread.Start(); // Wait for the new thread to finish while pumping any COM messages staThread.Join(); // Grab the return value pvaOut = launchAction.ReturnValue; } }
public void Exec(Guid pguidCmdGroup, uint nCmdID, OLECMDEXECOPT nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) { if ((nCmdID == 0) && (nCmdexecopt != OLECMDEXECOPT.OLECMDEXECOPT_SHOWHELP)) { Bho.ShowOptionsDlg(); } }
public void Exec( Guid pguidCmdGroup , uint nCmdID , OLECMDEXECOPT nCmdexecopt , IntPtr pvaIn , IntPtr pvaOut ) { if ( (nCmdID == 0) && (nCmdexecopt != OLECMDEXECOPT.OLECMDEXECOPT_SHOWHELP) ) { Bho.ShowOptionsDlg(); } }
/// <include file='doc\OleMenuCommand.uex' path='docs/doc[@for="OleMenuCmdEventArgs.OleMenuCmdEventArgs"]/*' /> /// <summary> /// Builds the OleMenuCmdEventArgs /// </summary> /// <param name="inParam">The input parameter to the command function.</param> /// <param name="outParam">A pointer to the parameter returned by the function</param> /// <param name="options">Execution options for the command.</param> public OleMenuCmdEventArgs(object inParam, IntPtr outParam, OLECMDEXECOPT options) : base() { this.execOptions = options; this.inParam = inParam; this.outParam = outParam; }
/// <summary> /// ウェブブラウザの取得操作の実行 /// </summary> /// <param name="cmdId">コマンドID</param> /// <param name="cmdExecOpt">コマンド実行オプション</param> /// <returns>結果</returns> private object ExecWB(OLECMDID cmdId, OLECMDEXECOPT cmdExecOpt) { object pvaIn = Type.Missing; object pvaOut = Type.Missing; this.webBrowser.ExecWB(cmdId, cmdExecOpt, ref pvaIn, ref pvaOut); return(pvaOut); }
public override void Invoke(object inArg, IntPtr outArg, OLECMDEXECOPT options) { var envs = _envSwitchMgr.AllFactories .Select(f => f.Configuration.Description) .OrderBy(desc => desc) .Append(Strings.AddEnvironmentComboListEntry) .ToArray(); Marshal.GetNativeVariantForObject(envs, outArg); }
/// <summary> /// Execute the command with an input and an output parameter /// </summary> /// <param name="input">input parameter</param> /// <param name="output">output parameter</param> public virtual void Execute(OLECMDEXECOPT execOption, object input, ref object output) { if (UseNullOutputParam) { ((IOleCommandTargetNullOutputParam)commandTarget).Exec(CGID.MSHTML, commandID, execOption, ref input, IntPtr.Zero); } else { commandTarget.Exec(CGID.MSHTML, commandID, execOption, ref input, ref output); } }
public virtual void Invoke(object inArg, IntPtr outArg, OLECMDEXECOPT options) { try { OleMenuCmdEventArgs args = new OleMenuCmdEventArgs(inArg, outArg, options); execHandler(this, args); } catch (CheckoutException ex) { if (CheckoutException.Canceled != ex) { throw; } } }
protected override bool HandlePreExec(ref Guid commandGroup, uint commandId, OLECMDEXECOPT executionOptions, IntPtr pvaIn, IntPtr pvaOut) { if (commandGroup == typeof(VSConstants.VSStd97CmdID).GUID) { switch ((VSConstants.VSStd97CmdID)commandId) { case VSConstants.VSStd97CmdID.GotoDefn: return(TryGoToDefinition()); default: break; } } return(base.HandlePreExec(ref commandGroup, commandId, executionOptions, pvaIn, pvaOut)); }
protected override bool HandlePreExec(ref Guid commandGroup, uint commandId, OLECMDEXECOPT executionOptions, IntPtr pvaIn, IntPtr pvaOut) { if (commandGroup == typeof(VSConstants.VSStd97CmdID).GUID) { switch ((VSConstants.VSStd97CmdID)commandId) { case VSConstants.VSStd97CmdID.GotoDefn: return TryGoToDefinition(); default: break; } } return base.HandlePreExec(ref commandGroup, commandId, executionOptions, pvaIn, pvaOut); }
public override void Invoke(object inArg, IntPtr outArg, OLECMDEXECOPT options) { // getting the current value if (outArg != IntPtr.Zero) { var text = _envSwitchMgr.CurrentFactory?.Configuration.Description ?? string.Empty; Marshal.GetNativeVariantForObject(text, outArg); } // setting the current value if (inArg != null) { var text = inArg as string; var factory = _envSwitchMgr.AllFactories.SingleOrDefault(f => f.Configuration.Description == text); SwitchToFactoryAsync(factory).HandleAllExceptions(_serviceProvider, GetType()).DoNotWait(); } }
public override void Invoke(object inArg, IntPtr outArg, OLECMDEXECOPT options) { var logger = _serviceProvider.GetService(typeof(IPythonToolsLogger)) as IPythonToolsLogger; // getting the current value if (outArg != IntPtr.Zero) { var text = EnvSwitchManager.CurrentFactory?.Configuration.Description ?? string.Empty; Marshal.GetNativeVariantForObject(text, outArg); } // setting the current value if (inArg != null) { var text = inArg as string; var factory = EnvSwitchManager.AllFactories.SingleOrDefault(f => f.Configuration.Description == text); if (factory != null) { logger?.LogEvent(PythonLogEvent.SelectEnvFromToolbar, new SelectEnvFromToolbarInfo() { InterpreterId = factory.Configuration.Id, Architecture = factory.Configuration.Architecture.ToString(), Version = factory.Configuration.Version.ToString(), IsIronPython = factory.Configuration.IsIronPython(), }); SwitchToFactoryAsync(factory).HandleAllExceptions(_serviceProvider, GetType()).DoNotWait(); } else { // The special "Add Environment..." entry, or any entry that no longer exists brings up the add dialog logger?.LogEvent(PythonLogEvent.AddEnvFromToolbar, null); AddEnvironmentCommand .AddEnvironmentAsync(_serviceProvider, AddEnvironmentDialog.PageKind.VirtualEnvironment) .HandleAllExceptions(_serviceProvider, GetType()) .DoNotWait(); } } }
/// <summary> /// Handles command execution. /// </summary> /// <param name="cmdGroup">Unique identifier of the command group</param> /// <param name="cmd">The command to be executed.</param> /// <param name="nCmdexecopt">Values describe how the object should execute the command.</param> /// <param name="pvaIn">Pointer to a VARIANTARG structure containing input arguments. Can be NULL</param> /// <param name="pvaOut">VARIANTARG structure to receive command output. Can be NULL.</param> /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns> protected override int ExecCommandOnNode(Guid cmdGroup, uint cmd, OLECMDEXECOPT nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) { if (cmdGroup == VsMenus.guidStandardCommandSet97) { switch ((VsCommands)cmd) { case VsCommands.UnloadProject: return this.UnloadProject(); case VsCommands.CleanSel: case VsCommands.CleanCtx: return this.CleanProject(); } } else if (cmdGroup == VsMenus.guidStandardCommandSet2K) { switch ((VsCommands2K)cmd) { case VsCommands2K.ADDREFERENCE: return this.AddProjectReference(); case VsCommands2K.ADDWEBREFERENCE: case VsCommands2K.ADDWEBREFERENCECTX: return this.AddWebReference(); case VsCommands2K.SLNREFRESH: RefreshProject(); return VSConstants.S_OK; case ProjectFileConstants.CommandExploreFolderInWindows: ExploreFolderInWindows(this.ProjectFolder); return VSConstants.S_OK; } } return base.ExecCommandOnNode(cmdGroup, cmd, nCmdexecopt, pvaIn, pvaOut); }
public void Exec(Guid pguidCmdGroup, uint nCmdID, OLECMDEXECOPT nCmdexecopt, ref object pvaIn, ref object pvaOut) { if (nCmdID == 0) { using (Process p = Process.GetCurrentProcess()) pvaOut = p.Id; } else if (nCmdID == 1) { // WinLive 198331 // We could be on an MTA thread at this point, but action here involves writer UI // and we need an STA compliant thread for it. We will spin up a new thread here // which is explicitly set to STA and launch our action through it. LaunchActionThreadWithState launchAction = new LaunchActionThreadWithState(_action, pvaIn as string[]); Thread staThread = new Thread(new ThreadStart(launchAction.ThreadProc)); // Set to STA model staThread.SetApartmentState(ApartmentState.STA); staThread.Start(); // Wait for the new thread to finish while pumping any COM messages staThread.Join(); // Grab the return value pvaOut = launchAction.ReturnValue; } }
/// <summary> /// Execute the command without parameters /// </summary> public virtual void Execute(OLECMDEXECOPT execOption) { Execute(execOption, null); }
/// <summary> /// Execute the command with an input parameter /// </summary> /// <param name="input">input parameter</param> public virtual void Execute(OLECMDEXECOPT execOption, object input) { object output = null; Execute(execOption, input, ref output); }
/// <include file='doc\OleMenuCommand.uex' path='docs/doc[@for="OleMenuCmdEventArgs.OleMenuCmdEventArgs"]/*' /> /// <summary> /// Builds the OleMenuCmdEventArgs /// </summary> /// <param name="inParam">The input parameter to the command function.</param> /// <param name="outParam">A pointer to the parameter returned by the function</param> /// <param name="options">Execution options for the command.</param> public OleMenuCmdEventArgs(object inParam, IntPtr outParam, OLECMDEXECOPT options) : base() { this.execOptions = options; this.inParam = inParam; this.outParam = outParam; }
public int Exec(ref Guid pguidCmdGroup, uint nCmdID, OLECMDEXECOPT nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) { // Supress window.alert and script errors if (nCmdID == OLECMDID.SHOWSCRIPTERROR || nCmdID == OLECMDID.SHOWMESSAGE) return HRESULT.S_OK; return HRESULT.E_NOTIMPL; }
public virtual void Invoke(object inArg, IntPtr outArg, OLECMDEXECOPT options) { try { OleMenuCmdEventArgs args = new OleMenuCmdEventArgs(inArg, outArg, options); execHandler(this, args); } catch (CheckoutException ex) { if (CheckoutException.Canceled != ex) throw; } }