Exemple #1
0
        public FieldDefinition GetField(string pName)
        {
            if (!_fields.ContainsKey(pName))
            {
                return(null);
            }

            var fd = _fields[pName];

            if (IsGeneric && fd.Type.IsGenericDefinition)
            {
                SmallType t = null;
                if (GenericTypeArgs.Length > 1)
                {
                    t = CreateTupleOf(GenericTypeArgs);
                }
                else
                {
                    t = GenericTypeArgs[0];
                }

                if (fd.Type.IsArray)
                {
                    t = t.MakeArrayType();
                }
                fd = new FieldDefinition(fd.Name, t);
            }
            return(fd);
        }
Exemple #2
0
        public static SmallType FromString(string pNamespace, string pName)
        {
            SmallType type = _types.FromString(pNamespace, pName);

            if (type == Undefined && pName.Length > 0 && Char.ToUpperInvariant(pName[0]) == 'A')
            {
                pName = pName.Substring(1);
                type  = _types.FromString(pNamespace, pName);
                type  = type.MakeArrayType();
            }

            return(type);
        }