Exemplo n.º 1
0
 public static void ReadMap(BinaryReader br, Dictionary <string, object> row, Dictionary <int, string> map)
 {
     while (true)
     {
         DBRowBinarySeparator separator = PeekSeparator(br);
         if (separator != DBRowBinarySeparator.RowStart &&
             separator != DBRowBinarySeparator.None)
         {
             break;
         }
         int    column = br.ReadInt32();
         object value  = Helper.ReadBinary(br);
         row[map[column]] = value;
     }
 }
Exemplo n.º 2
0
 public static void Read(BinaryReader br, DBItem row, Dictionary <int, string> map)
 {
     while (true)
     {
         DBRowBinarySeparator separator = PeekSeparator(br);
         if (separator != DBRowBinarySeparator.RowStart &&
             separator != DBRowBinarySeparator.None)
         {
             break;
         }
         int      column   = br.ReadInt32();
         object   value    = Helper.ReadBinary(br);
         DBColumn dbColumn = row.Table.ParseColumn(map[column]);
         row.SetValue(value, dbColumn, false);
     }
     row.Accept((IUserIdentity)null);
 }
Exemplo n.º 3
0
        public static Dictionary <int, string> ReadColumns(BinaryReader br, DBTable table)
        {
            Dictionary <int, string> map = new Dictionary <int, string>(table.Columns.Count);

            while (true)
            {
                DBRowBinarySeparator separator = PeekSeparator(br);
                if (separator != DBRowBinarySeparator.ColumnsStart &&
                    separator != DBRowBinarySeparator.None)
                {
                    break;
                }

                string column = br.ReadString();
                int    index  = br.ReadInt32();
                map.Add(index, column);
            }
            return(map);
        }
Exemplo n.º 4
0
 public static void WriteSeparator(BinaryWriter writer, DBRowBinarySeparator sep)
 {
     byte[] bytes = BitConverter.GetBytes((int)sep);
     writer.Write(bytes, 0, 3);
 }