Пример #1
0
        public web_res fnc_ele(int id, string name, string[] args = null)
        {
            web_element e = this.eles.FirstOrDefault(x => x.id == id);

            if (e == null)
            {
                throw new Exception($"elemento {id} non trovato");
            }
            return(e.fnc(name, args));
        }
Пример #2
0
 public void upd_element(int?id = null, int?id_element = null)
 {
     try {
         web_element e = this.eles.FirstOrDefault(x => (id.HasValue && x.id == id) || (id_element.HasValue && x.id_element == id_element));
         if (e != null)
         {
             this.browser.Document.InvokeScript("update_element", new object[] { e.id, e.get_html() });
         }
     } catch (Exception ex) { main.set_status_err(ex); }
 }
Пример #3
0
        public void add_element(web_element e)
        {
            this.eles.Add(e);
            e.view = this;

            if (!contains_element(e))
            {
                e.add_header();
            }

            e.add_html();

            string tp = e.GetType().Name;

            if (!this.types.Contains(tp))
            {
                this.types.Add(tp);
            }
        }
Пример #4
0
 public bool contains_element(web_element e)
 {
     return(this.types.Contains(e.GetType().Name));
 }
Пример #5
0
 public web_element new_element(web_element e)
 {
     this.eles.Add(e); e.view = this; return(e);
 }