예제 #1
0
        // This returns the type handler for the given argument
        public TypeHandler GetArgumentHandler(ArgumentInfo arginfo)
        {
            Type t = typeof(NullHandler);
            TypeHandlerAttribute ta = null;

            // Do we have a handler type for this?
            if (handlertypes.ContainsKey(arginfo.Type))
            {
                ta = handlertypes[arginfo.Type];
                t  = ta.Type;
            }

            // Create instance
            TypeHandler th = (TypeHandler)General.ThisAssembly.CreateInstance(t.FullName);

            th.SetupArgument(ta, arginfo);
            return(th);
        }
예제 #2
0
        // This returns the type handler for a given universal field
        public TypeHandler GetFieldHandler(UniversalFieldInfo fieldinfo)
        {
            Type t = typeof(NullHandler);
            TypeHandlerAttribute ta = null;

            // Do we have a handler type for this?
            if (handlertypes.ContainsKey(fieldinfo.Type))
            {
                ta = handlertypes[fieldinfo.Type];
                t  = ta.Type;
            }

            // Create instance
            TypeHandler th = (TypeHandler)General.ThisAssembly.CreateInstance(t.FullName);

            th.SetupField(ta, fieldinfo);
            th.SetValue(fieldinfo.Default);
            return(th);
        }
예제 #3
0
        // This returns the type handler for a custom universal field
        public TypeHandler GetFieldHandler(int type, object defaultsetting)
        {
            Type t = typeof(NullHandler);
            TypeHandlerAttribute ta = null;

            // Do we have a handler type for this?
            if (handlertypes.ContainsKey(type))
            {
                ta = handlertypes[type];
                t  = ta.Type;
            }

            // Create instance
            TypeHandler th = (TypeHandler)General.ThisAssembly.CreateInstance(t.FullName);

            th.SetupField(ta, null);
            th.SetValue(defaultsetting);
            return(th);
        }