Exemplo n.º 1
0
        public EventList_EventRow(int eventId)
        {
            this.EventId = eventId;

            this.Tr = new ElementBase(
                string.Format("//table[@id='ctl00_ctl00_cphDialog_cpMgrMain_rdgrdgrdForms_ctl00']/tbody/tr[@data-id='{0}']", eventId),
                LocateBy.XPath);

            string[] idAttribute = Tr.GetAttribute("id").Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries);
            this.RowIndex = Convert.ToInt32(idAttribute[idAttribute.Length - 1]) + 1;

            this.Title = new Clickable(
                string.Format("{0}/td/a[@class='listEventTile']", this.Tr.Locator),
                LocateBy.XPath);

            this.Delete = new Clickable(
                string.Format("{0}/td/div[@class='actions']/a[@title='Delete event']", this.Tr.Locator),
                LocateBy.XPath);

            this.EventURL = new Clickable(
                string.Format("{0}/td//a[contains(@title,'regonline.com')]", this.Tr.Locator),
                LocateBy.XPath).GetAttribute("href");
        }
        public void SetGeneratedCodeHtml(DataCollection.HtmlButton button)
        {
            ElementBase TextArea_GeneratedCode = new ElementBase(string.Format("code_{0}", (int)button.Graphic_Type), UIUtility.LocateBy.Id);

            StringBuilder script = new StringBuilder();
            script.Append(string.Format("var textArea_GeneratedCode = document.getElementById('{0}');", TextArea_GeneratedCode.Locator));
            script.Append(string.Format("textArea_GeneratedCode.setAttribute('value', textArea_GeneratedCode.value);", TextArea_GeneratedCode.Locator));

            UIUtility.UIUtil.DefaultProvider.ExecuteJavaScript(script.ToString());
            button.CodeHtml = TextArea_GeneratedCode.GetAttribute("value");
        }