public bool AcceptsValue(int?value)
        {
            if (value.HasValue)
            {
                return(DbaseInt32.FormatAsString(value.Value).Length <= Field.Length.ToInt32());
            }

            return(true);
        }
예제 #2
0
 public static void WriteAsNullableInt32(this BinaryWriter writer, DbaseField field, int?value)
 {
     if (value.HasValue)
     {
         var unpadded = DbaseInt32.FormatAsString(value.Value);
         writer.WriteLeftPaddedString(unpadded, field.Length.ToInt32(), ' ');
     }
     else
     {
         writer.Write(new string(' ', field.Length.ToInt32()).ToCharArray());
         // or writer.Write(new byte[Field.Length]); // to determine
     }
 }