private TypeCode GetTypeCodeImpl() { switch (this.Name) { case "bool": case "boolean": return(TypeCode.Boolean); case "number": return(TypeCode.Double); case "i8": return(TypeCode.SByte); case "i16": return(TypeCode.Int16); case "i32": return(TypeCode.Int32); case "i64": return(TypeCode.Int64); case "u8": return(TypeCode.Byte); case "u16": return(TypeCode.UInt16); case "u32": return(TypeCode.UInt32); case "u64": return(TypeCode.UInt64); case "f32": return(TypeCode.Single); case "f64": return(TypeCode.Double); case "str": return(TypeCode.String); case "string": return(TypeCode.String); case "object": case "any": return(TypeCode.Any); case "datetime": return(TypeCode.Date); } if (this != UnderlyingSystemType && UnderlyingSystemType != null) { return(XzaarType.GetTypeCode(UnderlyingSystemType)); } return(TypeCode.Any); }
public void AddField(XzaarType type, string name) { this.fields.Add(new XzaarFieldBuilder(name, type, this)); }
public XzaarTypeBuilder(string name, XzaarType declaringType, XzaarType underlyingSystemType, XzaarType baseType, XzaarType elementType = null) { Name = name; MemberType = XzaarMemberTypes.TypeInfo; DeclaringType = declaringType; UnderlyingSystemType = underlyingSystemType; BaseType = baseType; if (elementType != null) { isArray = true; arrayElementType = elementType; } }
public static bool TryGetType(string typeName, StructExpression typeExpression, out XzaarType newType) { var a = GetType(typeName); if (a == null || Equals(a, XzaarBaseTypes.Void) || Equals(a, XzaarBaseTypes.Any)) { newType = XzaarBaseTypes.CreateTypeFromStructExpression(typeExpression); XzaarBaseTypes.AddTypeToCache(newType); } else { newType = a; } return(true); }
public bool IsEquivalentTo(XzaarType other) { return(this == other); }
public XzaarFieldBuilder(string name, XzaarType fieldType, XzaarType declaringType) { this.name = name; this.fieldType = fieldType; this.declaringType = declaringType; }
internal static void AddTypeToCache(XzaarType type) { BaseTypes.Add(type); }
public XzaarParameterInfo(string name, XzaarType parameterType, object defautlValue) { Name = name; ParameterType = parameterType; DefautlValue = defautlValue; }