Exemplo n.º 1
0
        private ImageBit Deserialize(byte[] array)
        {
            Stream          stream    = Converter.ArrayToStream(array);
            BinaryFormatter formatter = new BinaryFormatter();

            return((ImageBit)formatter.Deserialize(stream));
        }
Exemplo n.º 2
0
 private void GetUsersList()
 {
     while (true)
     {
         try
         {
             byte[] buffer = (byte[])server.Receive();
             if (buffer.Length != 0)
             {
                 Stream          stream    = Converter.ArrayToStream(buffer);
                 BinaryFormatter formatter = new BinaryFormatter();
                 usersList = (List <User>)formatter.Deserialize(stream);
                 CleanUserList();
                 DrawUsersList();
             }
         }
         catch
         {
         }
     }
 }