Exemple #1
0
        public static PrimitiveType Register <T>(string rawName, string name, string toString = null, params string[] constants) where T : struct
        {
            var type = new PrimitiveType();

            type.BaseType     = typeof(T);
            type.RawName      = rawName;
            type.Name         = name;
            type.NativeName   = NativeTypes.GetNativeName <T>();
            type.ToStringBody = toString;
            type.Constants    = constants;
            _primitiveTypes.Add(rawName, type);
            return(type);
        }
Exemple #2
0
        private static string TranslateName(string rawName)
        {
            string name;

            if (PrimitiveType.TryGetName(rawName, out name))
            {
                return(name);
            }
            if (NativeTypes.TryGetName(rawName, out name))
            {
                return(name);
            }

            switch (rawName)
            {
            case "DT_CSTRING":
            case "DT_FORMULA":
            case "DT_CHARARRAY": return("string");

            default:
                return(rawName);
            }
        }
Exemple #3
0
 public static bool IsNative(this FieldDescriptor field)
 {
     return(NativeTypes.Contains(field.GetFieldType().x04_Name));
 }
 public static bool IsNative(this ValueTypeDescriptor descriptor)
 {
     return(NativeTypes.Contains(descriptor.x04_Name));
 }