Scorpio.Util.IsDelegateType C# (CSharp) Method

IsDelegateType() public static method

public static IsDelegateType ( Type type ) : bool
type System.Type
return bool
        public static bool IsDelegateType(Type type) {
            return TYPE_DELEGATE.GetTypeInfo().IsAssignableFrom(type);
        }
        public static bool IsVoid(Type type) {

Usage Example

Example #1
0
        public ScriptUserdata CreateUserdata(object obj)
        {
            Type type = obj as Type;

            if (type != null)
            {
                if (type.GetTypeInfo().IsEnum)
                {
                    return(GetEnum(type));
                }
                else if (Util.IsDelegateType(type))
                {
                    return(GetDelegate(type));
                }
                else
                {
                    return(new ScriptUserdataObjectType(this, type, GetScorpioType(type)));
                }
            }
            if (obj is Delegate)
            {
                return(new ScriptUserdataDelegate(this, (Delegate)obj));
            }
            else if (obj is BridgeEventInfo)
            {
                return(new ScriptUserdataEventInfo(this, (BridgeEventInfo)obj));
            }
            return(new ScriptUserdataObject(this, obj, GetScorpioType(obj.GetType())));
        }
All Usage Examples Of Scorpio.Util::IsDelegateType