GetDelegate() 공개 메소드

public GetDelegate ( Type type ) : ScriptUserdata
type Type
리턴 ScriptUserdata
예제 #1
0
 public static object ChangeType(Script script, ScriptObject par, Type type)
 {
     if (type == TYPE_OBJECT)
     {
         return(par.ObjectValue);
     }
     else
     {
         if (par is ScriptUserdata && type == TYPE_TYPE)
         {
             return(((ScriptUserdata)par).ValueType);
         }
         else if (par is ScriptNumber)
         {
             return(ChangeType_impl(par.ObjectValue, type));
         }
         else if (TYPE_DELEGATE.GetTypeInfo().IsAssignableFrom(type))
         {
             if (par is ScriptFunction)
             {
                 return(script.GetDelegate(type).Call(new ScriptObject[] { par }));
             }
             else
             {
                 return(par.ObjectValue);
             }
         }
         else
         {
             return(par.ObjectValue);
         }
     }
 }
예제 #2
0
 public static object ChangeType(Script script, ScriptObject par, Type type)
 {
     if (type == TYPE_OBJECT) {
         return par.ObjectValue;
     } else {
         if (par is ScriptUserdata && type == TYPE_TYPE)
             return ((ScriptUserdata)par).ValueType;
         else if (par is ScriptNumber)
             return ChangeType_impl(par.ObjectValue, type);
         else if (TYPE_DELEGATE.GetTypeInfo().IsAssignableFrom(type)) {
             if (par is ScriptFunction)
                 return script.GetDelegate(type).Call(new ScriptObject[] { par });
             else
                 return par.ObjectValue;
         } else
             return par.ObjectValue;
     }
 }