예제 #1
0
        public Field(string name,
                     int nthOfType,
                     FieldType type,
                     bool isSigningField = true,
                     bool isSerialised   = true) :
            base(name,
                 (type.Ordinal << 16 | nthOfType))
        {
            // catch auxiliary fields
            var valid = (nthOfType > 0) && nthOfType < 256 &&
                        type.Ordinal > 0 && type.Ordinal < 256;

            Type           = type;
            IsSigningField = valid && isSigningField;
            IsSerialised   = valid && isSerialised;
            NthOfType      = nthOfType;
            IsVlEncoded    = IsVlEncodedType();
            Header         = CalculateHeader();
            Values.AddEnum(this);
        }
예제 #2
0
 public FieldType(string name, int ordinal) : base(name, ordinal)
 {
     Values.AddEnum(this);
 }
예제 #3
0
 private static LedgerEntryType Add(string reference, int ordinal)
 {
     return(Values.AddEnum(new LedgerEntryType(reference, ordinal)));
 }
예제 #4
0
 private static TransactionType Add(string name, int ordinal)
 {
     return(Values.AddEnum(new TransactionType(name, ordinal)));
 }