Esempio n. 1
0
        static FieldFunc DispatchFieldFunc(Type type)
        {
            if (!fieldFuncTable.TryGetValue(type, out var func))
            {
                if (type.IsEnum)
                {
                    func = new FieldFunc((obj, t) => EnumField(obj));
                }
                else if (TypeUtility.IsList(type))
                {
                    func = ListField;
                }
                else if (TypeUtility.IsRecursive(type))
                {
                    func = new FieldFunc((obj, t) => RecursiveField(obj));
                }
                else
                {
                    func = StandardField;
                }

                fieldFuncTable[type] = func;
            }

            return(func);
        }
Esempio n. 2
0
        static LabelRightFunc DispatchLabelRightFunc(Type type)
        {
            LabelRightFunc ret = null;

            if (TypeUtility.IsList(type))
            {
                ret = ListLabelRightFunc;
            }

            return(ret);
        }