public int TranslateAccelerator(MSG msg, ref Guid group, int nCmdID) { //illustrates how to trap and cancel an accelerator command // Debug.WriteLine("Translate Accel"); if (nCmdID == commandids.IDM_PASTE) { BeforePasteArgs e = new BeforePasteArgs(); container.OnBeforePaste(e); if (e.Cancel) { return(HRESULT.S_OK); //cancel the paste } } return(HRESULT.S_FALSE); }
public bool Paste() { BeforePasteArgs e = new BeforePasteArgs(); this.OnBeforePaste(e); if (e.Cancel) { return false; } else return this.execCommand(commandids.IDM_PASTE, null, false, true); }
/// <summary> /// Fires the BeforePaste event /// </summary> /// <param name="e"></param> protected internal virtual void OnBeforePaste(BeforePasteArgs e) { if (BeforePaste != null) BeforePaste(this, e); }
public int TranslateAccelerator(MSG msg, ref Guid group, int nCmdID) { //illustrates how to trap and cancel an accelerator command // Debug.WriteLine("Translate Accel"); if (nCmdID == commandids.IDM_PASTE) { BeforePasteArgs e = new BeforePasteArgs(); container.OnBeforePaste(e); if (e.Cancel) { return HRESULT.S_OK; //cancel the paste } } return HRESULT.S_FALSE; }