public int PreHandleEvent(int inEvtDispId, IHTMLEventObj pIEventObj) { // EventType [mouseover, mouseout, mousemove, mouseup] // When clicked something, check if it is module or not if (pIEventObj.EventType == "mousedown") { IHTMLElement module; if (isModule(pIEventObj.SrcElement, out module)) { // Fire event ElementDataEventArgs args = new ElementDataEventArgs(); args.element = module; args.eventObj = pIEventObj; this.moduleClicked(this, args); // And deny the rest return HRESULT.S_OK; } else { ElementDataEventArgs args = new ElementDataEventArgs(); args.element = pIEventObj.SrcElement; args.eventObj = pIEventObj; this.canvasClicked(this, args); } } return HRESULT.S_FALSE; }
public int PreHandleEvent(int inEvtDispId, IHTMLEventObj pIEventObj) { // EventType [mouseover, mouseout, mousemove, mouseup] // When clicked something, check if it is module or not if (pIEventObj.EventType == "mousedown") { IHTMLElement module; if (isModule(pIEventObj.SrcElement, out module)) { // Fire event ElementDataEventArgs args = new ElementDataEventArgs(); args.element = module; args.eventObj = pIEventObj; this.moduleClicked(this, args); // And deny the rest return(HRESULT.S_OK); } else { ElementDataEventArgs args = new ElementDataEventArgs(); args.element = pIEventObj.SrcElement; args.eventObj = pIEventObj; this.canvasClicked(this, args); } } return(HRESULT.S_FALSE); }