예제 #1
0
 private void RenderScriptBlock(StringBuilder sb, PlaceHolder ph)
 {
     if (sb.Length > 0)
     {
         string script = sb.ToString();
         if (Handlers.Resource.AllowMinify)
         {
             script = EcmaScript.Compress(script);
         }
         script = "<script type=\"text/ecmascript\">" + script + Environment.NewLine + "</script>";
         ph.Controls.Add(new LiteralControl(script));
     }
 }
예제 #2
0
        /// <remarks>
        /// By convention, some script objects are designed to support a particular
        ///	type and so are always constructed with that type's name.
        ///	Specifically, asynchronous method calls need a type against which
        ///	to invoke the method by reflection (see IDCL.Controls.Asynchronous).
        /// <see cref="IDCL.Controls.Asynchronous"/>
        /// </remarks>
        public static string CreateObject(string name, string typeName, Type t, object[] arguments)
        {
            int length = arguments.Length;

            object[] transfer = new object[length + 1];
            // type name needs to be first argument
            transfer[0] = t.QualifiedName();
            for (int x = 1; x <= length; x++)
            {
                transfer[x] = arguments[x - 1];
            }
            return(EcmaScript.CreateObject(name, typeName, transfer, null));
        }
예제 #3
0
 public static string CreateObject(string name, string typeName)
 {
     return(EcmaScript.CreateObject(name, typeName, new string[] { }, null));
 }
예제 #4
0
 public static string CreateObject(string name, string typeName, string[] arguments)
 {
     return(EcmaScript.CreateObject(name, typeName, arguments, null));
 }
예제 #5
0
 public static string CreateObject(string name, string typeName, Dictionary <string, object> properties)
 {
     return(EcmaScript.CreateObject(name, typeName, new string[] { }, properties));
 }
예제 #6
0
 public static string CreateObject(Type t, object[] arguments)
 {
     return(EcmaScript.CreateObject(t.Name, t, arguments));
 }
예제 #7
0
 public static string CreateObject(Type t)
 {
     return(EcmaScript.CreateObject(t.Name, t));
 }
예제 #8
0
 public static string CreateObject(string name, Type t)
 {
     return(EcmaScript.CreateObject(name, name + "Object", t));
 }
예제 #9
0
 // by convention, JS object function names end with "Object"
 public static string CreateObject(string name, Type t, object[] arguments)
 {
     return(EcmaScript.CreateObject(name, name + "Object", t, arguments));
 }
예제 #10
0
 public static string CreateObject(string name, string typeName, Type t)
 {
     return(EcmaScript.CreateObject(name, typeName, new string[] {
         t.QualifiedName()
     }, null));
 }