Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 public static Nodes.TypeDefinition CreateBuiltIn(DataType type)
 {
     if (type == DataType.Date) return CreateDate();
     return CreateBase(type);
 }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
 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;
 }