コード例 #1
0
        public bool AcceptsValue(short?value)
        {
            if (value.HasValue)
            {
                return(DbaseInt16.FormatAsString(value.Value).Length <= Field.Length.ToInt32());
            }

            return(true);
        }
コード例 #2
0
 public static void WriteAsNullableInt16(this BinaryWriter writer, DbaseField field, short?value)
 {
     if (value.HasValue)
     {
         var unpadded = DbaseInt16.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
     }
 }