public object Deserialize(CompactFormatter parent, Stream serializationStream)
 {
     if (PrimitiveSerializer.DeserializeByte(serializationStream) != (byte)15)
     {
         throw new System.Exception("was expecting STRING in stream");
     }
     return((object)new Guid(PrimitiveSerializer.DeserializeString(serializationStream)));
 }
 public object Deserialize(CompactFormatter parent, Stream serializationStream)
 {
     if (PrimitiveSerializer.DeserializeByte(serializationStream) != (byte)8)
     {
         throw new System.Exception("was expecting INT32 in stream");
     }
     return((object)new IntPtr(PrimitiveSerializer.DeserializeInt32(serializationStream)));
 }
        public void Serialize(CompactFormatter parent, Stream serializationStream, object graph)
        {
            Hashtable hashtable = (Hashtable)graph;

            PrimitiveSerializer.Serialize(hashtable.Count, serializationStream);
            foreach (object key in (IEnumerable)hashtable.Keys)
            {
                object graph1 = hashtable[key];
                parent.innerSerialize(serializationStream, key);
                parent.innerSerialize(serializationStream, graph1);
            }
        }
        public object Deserialize(CompactFormatter parent, Stream serializationStream)
        {
            Hashtable hashtable = new Hashtable();

            if (PrimitiveSerializer.DeserializeByte(serializationStream) != (byte)8)
            {
                throw new System.Exception("was expecting INT32 in stream");
            }
            int num = PrimitiveSerializer.DeserializeInt32(serializationStream);

            for (int index1 = 0; index1 < num; ++index1)
            {
                object index2 = parent.innerDeserialize(serializationStream);
                object obj    = parent.innerDeserialize(serializationStream);
                hashtable[index2] = obj;
            }
            return((object)hashtable);
        }
 public void Serialize(CompactFormatter parent, Stream serializationStream, object graph)
 {
     PrimitiveSerializer.Serialize(((IntPtr)graph).ToInt32(), serializationStream);
 }
 public void Serialize(CompactFormatter parent, Stream serializationStream, object graph)
 {
     PrimitiveSerializer.Serialize(((Guid)graph).ToString(), serializationStream);
 }
Exemplo n.º 7
0
 public void Serialize(CompactFormatter parent, Stream serializationStream, object graph)
 {
     PrimitiveSerializer.Serialize(((Uri)graph).OriginalString, serializationStream);
 }