Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }