// If onmouseup is canceled and onclick is not we'll fall back on OnCanceledClick case. private void OnHtmlMouseUp(object sender, EventArgs e) { // Reset any previous mouse up package. this.recLastMouseUpPackage = null; // On www.xero.com the source element we get on click event is messed up I don't know why. // Just keep the source recorder package we correctly get on mouseup event and use it with onclick event. if (this.IsRecording && (this.ClickAction != null)) { HtmlHandler htmlHandler = (HtmlHandler)sender; IHTMLElement htmlSource = [email protected]; if (!IsValidForClickRec(htmlSource)) { return; } // For non <img> elements take a parent anchor. Example: a <b> inside an <a>. Skip anchor with names (page bookmarks). IHTMLImgElement imgElem = htmlSource as IHTMLImgElement; if (imgElem == null) { IElement sourceElement = this.twebstCore.AttachToNativeElement(htmlSource); IElement parentAnchor = sourceElement.FindParentElement("a", "name="); // A parent anchor without a name. if (parentAnchor != null) { htmlSource = parentAnchor.nativeElement; } } this.recLastMouseUpPackage = RecEventArgs.CreateRecEvent(htmlSource, twebstBrowser); } }
private void OnHtmlChange(object sender, EventArgs e) { if (this.IsRecording && (this.ChangeAction != null)) { HtmlHandler htmlHandler = (HtmlHandler)sender; IHTMLElement htmlSource = [email protected]; RecEventArgs recPackage = RecEventArgs.CreateRecEvent(htmlSource, twebstBrowser); // Notify listeners about a recorded value change action. this.ChangeAction(this, recPackage); } }
private void OnIntroClick(object sender, EventArgs e) { HtmlHandler htmlHandler = (HtmlHandler)sender; IHTMLElement htmlSource = [email protected]; String sourceID = htmlSource.id; if (sourceID == CatStudioConstants.INTRO_START_REC_ATTR) { this.OnIntroStartRec(); } else if (sourceID == CatStudioConstants.INTRO_RUN_DEMO_ATTR) { this.OnIntroRunDemo(); } else if (sourceID == CatStudioConstants.INTRO_OPEN_SAMPLES_ATTR) { this.OnIntroOpenSamples(); } else if (sourceID == CatStudioConstants.INTRO_DONT_ASK_AGAIN_ATTR) { IHTMLInputElement inputSource = (IHTMLInputElement)htmlSource; this.OnIntroDontAskAgain(inputSource.@checked); } }