Scorpio.Script.GetDelegate C# (CSharp) Method

GetDelegate() public method

public GetDelegate ( Type type ) : ScriptUserdata
type Type
return ScriptUserdata
        public ScriptUserdata GetDelegate(Type type) {
            if (m_Delegates.ContainsKey(type))
                return m_Delegates[type];
            ScriptUserdataDelegateType ret = new ScriptUserdataDelegateType(this, type);
            m_Delegates.Add(type, ret);
            return ret;
        }
        public UserdataType GetScorpioType(Type type) {

Usage Example

Example #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);
         }
     }
 }
All Usage Examples Of Scorpio.Script::GetDelegate