示例#1
0
        private static Element Call(bool register, string name, params object[] arguments)
        {
            if (register)
            {
                DomHelper.RegisterScript(name, arguments);
                return(null);
            }

            return(DomHelper.ReturnElement(name, arguments));
        }
示例#2
0
 /// <summary>
 /// Creates new DOM element(s) and overwrites the contents of el with them.
 /// </summary>
 /// <param name="el">The context element</param>
 /// <param name="o">The DOM object spec (and children)</param>
 public static Element Overwrite(Element el, string o)
 {
     return(DomHelper.Call(false, "overwrite", new JRawValue(el.Descriptor), o, true));
 }
示例#3
0
 /// <summary>
 /// Creates new DOM element(s) and overwrites the contents of el with them.
 /// </summary>
 /// <param name="el">The context element</param>
 /// <param name="o">The DOM object spec (and children)</param>
 public static Element Overwrite(Element el, DomObject o)
 {
     return(DomHelper.Call(false, "overwrite", new JRawValue(el.Descriptor), new JRawValue(o.Serialize()), true));
 }
示例#4
0
 /// <summary>
 /// Creates new DOM element(s) and inserts them as the first child of el.
 /// </summary>
 /// <param name="el">The context element</param>
 /// <param name="o">The DOM object spec (and children)</param>
 public static Element InsertFirst(Element el, string o)
 {
     return(DomHelper.Call(false, "insertFirst", new JRawValue(el.Descriptor), o, true));
 }
示例#5
0
 /// <summary>
 /// Creates new DOM element(s) and inserts them as the first child of el.
 /// </summary>
 /// <param name="el">The context element</param>
 /// <param name="o">The DOM object spec (and children)</param>
 public static Element InsertFirst(Element el, DomObject o)
 {
     return(DomHelper.Call(false, "insertFirst", new JRawValue(el.Descriptor), new JRawValue(o.Serialize()), true));
 }
示例#6
0
 /// <summary>
 /// Applies a style specification to an element.
 /// </summary>
 /// <param name="el">The element to apply styles to</param>
 /// <param name="styles">A style specification.</param>
 public static void ApplyStyles(Element el, Dictionary <string, string> styles)
 {
     DomHelper.Call(true, "applyStyles", new JRawValue(el.Descriptor), styles);
 }
示例#7
0
 /// <summary>
 /// Creates new DOM element(s) and appends them to el.
 /// </summary>
 /// <param name="el">The context element</param>
 /// <param name="o">Raw HTML blob</param>
 public static Element Append(Element el, string o)
 {
     return(DomHelper.Call(false, "append", new JRawValue(el.Descriptor), o, true));
 }
示例#8
0
 /// <summary>
 /// Creates new DOM element(s) and appends them to el.
 /// </summary>
 /// <param name="el">The context element</param>
 /// <param name="o">The DOM object spec (and children) or raw HTML blob</param>
 public static Element Append(Element el, DomObject o)
 {
     return(DomHelper.Call(false, "append", new JRawValue(el.Descriptor), new JRawValue(new ClientConfig().Serialize(o)), true));
 }