private static bool TestConversion(string picture, DataType expected, char[] currencies = null) { DataType result; if (currencies == null) result = DataType.Create(picture); else result = DataType.Create(picture, currencies); if (result != expected) throw new System.Exception("\""+picture+"\">"+result+" vs expected: "+expected); return result == expected; }
public static Nodes.TypeDefinition CreateBuiltIn(DataType type) { if (type == DataType.Date) return CreateDate(); return CreateBase(type); }
private static Nodes.TypeDefinition CreateBase(DataType type) { var entry = new DataTypeDescriptionEntry(); entry.LevelNumber = new GeneratedIntegerValue(1); entry.DataName = new SymbolDefinition(new GeneratedAlphanumericValue(type.Name), SymbolType.DataName); entry.DataType = type; return new Nodes.TypeDefinition(entry); }
public Parameter(SymbolReference name, bool isCustom, DataType type, int length=int.MaxValue) { this.Name = name; this.Type = type; this.Length = length; if (length < 1) throw new System.ArgumentOutOfRangeException("Length must be >0 (actual: "+length+')'); this.IsCustom = isCustom; }