Пример #1
0
        object ReadExt(Format format, FormatReader reader)
        {
            uint  length  = reader.ReadExtLength(format);
            sbyte extType = reader.ReadExtType(format);

            return(context.TypeHandlers.GetExt(extType).ReadExt(length, reader));
        }
Пример #2
0
        void ReadExt(Format format)
        {
            uint   length  = reader.ReadExtLength(format);
            sbyte  extType = reader.ReadExtType(format);
            object value   = context.TypeHandlers.GetExt(extType).ReadExt(length, reader);

            Append(value.ToString());
        }
Пример #3
0
 public object Read(Format format, FormatReader reader)
 {
     if (format.IsExtFamily)
     {
         uint length = reader.ReadExtLength(format);
         if (ExtType == reader.ReadExtType(reader.ReadFormat()))
         {
             return(ReadExt(length, reader));
         }
     }
     if (format.IsStringFamily)
     {
         stringHandler = stringHandler ?? context.TypeHandlers.Get <string>();
         string dateTimeStr = (string)stringHandler.Read(format, reader);
         return(DateTime.Parse(dateTimeStr));
     }
     if (format.IsFloatFamily || format.IsIntFamily)
     {
         doubleHandler = doubleHandler ?? context.TypeHandlers.Get <double>();
         double seconds = (double)doubleHandler.Read(format, reader);
         return(epoch.AddSeconds(seconds).ToLocalTime());
     }
     throw new FormatException(this, format, reader);
 }