Esempio n. 1
0
 public static Row Deserialize(FrontendInstanceBase fib, byte[] chunkID, BaseDataObject baseDataObject, byte[] buffer)
 {
     using (System.IO.MemoryStream MS = new System.IO.MemoryStream(buffer)) {
         using (System.IO.BinaryReader BR = new System.IO.BinaryReader(MS)) {
             byte[] id             = BR.ReadBytes(32);
             Table  table          = ((FrontendInstance)fib).GetTableByID(BR.ReadBytes(32));
             byte   columnSetCount = BR.ReadByte();
             Dictionary <int, ColumnSet> columnSets = new Dictionary <int, ColumnSet> ();
             for (int columnSetIndex = 0; columnSetIndex != columnSetCount; columnSetIndex++)
             {
                 ColumnSet columnSet = ((FrontendInstance)fib).GetColumnSetByID(BR.ReadBytes(32));
                 columnSets.Add(columnSetIndex, columnSet);
             }
             //int previousVersionCount = BR.ReadInt32 ();
             Dictionary <int, object[]> objs = new Dictionary <int, object[]> ();
             for (int n = 0; n != columnSetCount; n++)
             {
                 objs.Add(n, columnSets [n].DeserializeObjects(BR.ReadBytes(BR.ReadInt32())));
             }
             Row R = new Row(id,
                             chunkID,
                             baseDataObject,
                             table,
                             columnSets,
                             objs);
             return(R);
         }
     }
 }
Esempio n. 2
0
 public static BaseMetaObject Deserialize(FrontendInstanceBase fib, byte[] chunkID, byte[] buffer)
 {
     using (System.IO.MemoryStream MS = new System.IO.MemoryStream(buffer)) {
         using (System.IO.BinaryReader BR = new System.IO.BinaryReader(MS)) {
             return(new Table(fib, BR.ReadBytes(32), chunkID, BR.ReadString()));
         }
     }
 }
Esempio n. 3
0
 public static Column Deserialize(FrontendInstanceBase fib, byte[] chunkID, byte[] buffer)
 {
     using (System.IO.MemoryStream MS = new System.IO.MemoryStream(buffer)) {
         using (System.IO.BinaryReader BR = new System.IO.BinaryReader(MS)) {
             return(new Column(fib, BR.ReadBytes(32), chunkID, BR.ReadString(), ((Frontend)fib.Frontend).ValueDeserializer.IDToType(BR.ReadByte()), BR.ReadBoolean(), BR.ReadInt64()));
         }
     }
 }
Esempio n. 4
0
 public Table(FrontendInstanceBase frontendInstanceBase, byte[] objectID, byte[] chunkID, string name)
     : base(frontendInstanceBase, objectID, chunkID)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     this.name = name;
 }
Esempio n. 5
0
 public static ColumnSet Deserialize(FrontendInstanceBase frontendInstanceBase, byte[] chunkID, byte[] buffer)
 {
     using (MemoryStream MS = new MemoryStream(buffer)) {
         using (BinaryReader BR = new BinaryReader(MS)) {
             byte[]   id          = BR.ReadBytes(32);
             int      columnCount = BR.ReadInt32();
             Column[] columns     = new Column[columnCount];
             for (int n = 0; n != columnCount; n++)
             {
                 columns [n] = ((FrontendInstance)frontendInstanceBase).GetColumnByID(BR.ReadBytes(32));
             }
             return(new ColumnSet((FrontendInstance)frontendInstanceBase, id, chunkID, columns));
         }
     }
 }
Esempio n. 6
0
 public Column(FrontendInstanceBase frontendInstanceBase,
               byte[] id,
               byte[] chunkID,
               string name, Type type, bool allowNull, long length)
     : base(frontendInstanceBase, id, chunkID)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     this.name      = name;
     this.type      = type;
     this.allowNull = allowNull;
     this.length    = length;
 }
Esempio n. 7
0
 public BaseDataObjectVersion Deserialize(FrontendInstanceBase fib, byte[] chunkID, byte[] buffer)
 {
     if (fib == null)
     {
         throw new ArgumentNullException("fib");
     }
     if (chunkID == null)
     {
         throw new ArgumentNullException("chunkID");
     }
     if (buffer == null)
     {
         throw new ArgumentNullException("buffer");
     }
     if (deserialize == null)
     {
         ResolveMethod();
     }
     return((BaseDataObjectVersion)deserialize.Invoke(null, new object[] { fib, chunkID, buffer }));
 }
Esempio n. 8
0
 public DataContext(FrontendInstanceBase frontendInstanceBase, DataContext baseContext)
     : base(baseContext)
 {
     this.frontendInstanceBase = (FrontendInstance)frontendInstanceBase;
 }