Ejemplo n.º 1
0
 public button(string txt, string css = "", string tooltip = "", attrs a = null, styles s = null, EventHandler eclick = null)
     : base(new Button())
 {
     btn.Text = txt;
     if (css != "")
     {
         btn.CssClass = css;
     }
     if (tooltip != "")
     {
         btn.ToolTip = tooltip;
     }
     if (a != null)
     {
         a.add_toctrl(btn);
     }
     if (s != null)
     {
         s.add_toctrl(btn);
     }
     if (eclick != null)
     {
         btn.Click += eclick;
     }
 }
Ejemplo n.º 2
0
 public text(string text, string css = "", string tooltip = "", attrs a = null, styles st = null, string id = null)
     : base(new TextBox())
 {
     txt.Text = text;
     if (!string.IsNullOrEmpty(css))
     {
         txt.CssClass = css;
     }
     if (!string.IsNullOrEmpty(tooltip))
     {
         txt.ToolTip = tooltip;
     }
     if (a != null)
     {
         a.add_toctrl(txt);
     }
     if (st != null)
     {
         st.add_toctrl(txt);
     }
     if (id != null)
     {
         txt.ID = id;
     }
 }
Ejemplo n.º 3
0
 public label(string text, string css = "", string tooltip = "", attrs a = null, styles st = null, string id = null)
     : base(new Label())
 {
     lbl.Text = text;
     if (!string.IsNullOrEmpty(css))
     {
         lbl.CssClass = css;
     }
     if (!string.IsNullOrEmpty(tooltip))
     {
         lbl.ToolTip = tooltip;
     }
     if (a != null)
     {
         a.add_toctrl(lbl);
     }
     if (st != null)
     {
         st.add_toctrl(lbl);
     }
     if (id != null)
     {
         lbl.ID = id;
     }
 }
Ejemplo n.º 4
0
 public txt_area(string id, string txt, attrs a = null, styles s = null)
     : base(new HtmlTextArea())
 {
     harea.ID        = id;
     harea.InnerText = txt;
     if (s != null)
     {
         s.add_toctrl(h_ctrl);
     }
     if (a != null)
     {
         a.add_toctrl(h_ctrl);
     }
 }
Ejemplo n.º 5
0
 public html_ctrl(string tag, attrs a = null, styles s = null, string id = null, string html = null)
     : base(new HtmlGenericControl(tag))
 {
     if (id != null)
     {
         hctrl.ID = id;
     }
     if (html != null)
     {
         hctrl.InnerHtml = html;
     }
     if (s != null)
     {
         s.add_toctrl(h_ctrl);
     }
     if (a != null)
     {
         a.add_toctrl(h_ctrl);
     }
 }
Ejemplo n.º 6
0
 public link(string txt  = null, string tooltip = null, string css_class = null, string url = null, attrs a = null
             , styles st = null, string id      = null, string target    = null)
     : base(new HyperLink())
 {
     if (!string.IsNullOrEmpty(css_class))
     {
         hlink.CssClass = css_class;
     }
     if (!string.IsNullOrEmpty(txt))
     {
         hlink.Text = txt;
     }
     if (!string.IsNullOrEmpty(tooltip))
     {
         hlink.ToolTip = tooltip;
     }
     if (a != null)
     {
         a.add_toctrl(hlink);
     }
     if (st != null)
     {
         st.add_toctrl(hlink);
     }
     if (!string.IsNullOrEmpty(url))
     {
         hlink.NavigateUrl = url;
     }
     if (id != null)
     {
         hlink.ID = id;
     }
     if (target != null)
     {
         hlink.Target = target;
     }
 }
Ejemplo n.º 7
0
 public tbl_cell(string id           = null, HorizontalAlign?align = null, List <ctrl> ctrls = null, attrs a = null
                 , styles st         = null, string css            = "", int col_span = -1, string tooltip   = "", HorizontalAlign hal = HorizontalAlign.NotSet
                 , VerticalAlign val = VerticalAlign.NotSet)
     : base(new TableCell())
 {
     if (!string.IsNullOrEmpty(id))
     {
         _ctrl.ID = id;
     }
     if (align.HasValue)
     {
         cell.HorizontalAlign = align.Value;
     }
     if (ctrls != null)
     {
         ctrls.ForEach(ctrl => { add(ctrl.control); });
     }
     if (a != null)
     {
         a.add_toctrl(cell);
     }
     if (st != null)
     {
         st.add_toctrl(cell);
     }
     if (!string.IsNullOrEmpty(css))
     {
         cell.CssClass = css;
     }
     if (col_span >= 0)
     {
         cell.ColumnSpan = col_span;
     }
     if (!string.IsNullOrEmpty(tooltip))
     {
         cell.ToolTip = tooltip;
     }
     if (hal != HorizontalAlign.NotSet)
     {
         cell.HorizontalAlign = hal;
     }
     if (val != VerticalAlign.NotSet)
     {
         cell.VerticalAlign = val;
     }
 }
Ejemplo n.º 8
0
 public tbl(string id = null, string css_class = null, List <tbl_row> rows = null, attrs at = null, styles st = null, string caption = null)
     : base(new Table())
 {
     if (!string.IsNullOrEmpty(id))
     {
         table.ID = id;
     }
     if (!string.IsNullOrEmpty(css_class))
     {
         table.CssClass = css_class;
     }
     if (rows != null)
     {
         rows.ForEach(rw => { add(rw); });
     }
     if (at != null)
     {
         at.add_toctrl(table);
     }
     if (st != null)
     {
         st.add_toctrl(table);
     }
     if (!string.IsNullOrEmpty(caption))
     {
         table.Caption = caption;
     }
 }