Ejemplo n.º 1
0
 /// <summary>
 /// Test buffer with UI
 /// </summary>
 /// <param name="buffer">Byte buffer that contains scenario</param>
 /// <param name="binder">Serialization binder</param>
 /// <param name="pan">Desktop</param>
 /// <param name="ext">Extension</param>
 /// <param name="extd">Required extension</param>
 /// <returns>Test exception</returns>
 public Exception TestBuffer(byte[] buffer, SerializationBinder binder, PanelDesktop pan, string ext, string extd)
 {
     try
     {
         MemoryStream ms = new MemoryStream(buffer);
         pan.LoadFromStream(ms, binder, ext, extd);
         foreach (object o in pan.Controls)
         {
             if (o is IShowForm)
             {
                 IShowForm sf = o as IShowForm;
                 sf.ShowForm();
             }
         }
         pan.TempDelete();
     }
     catch (Exception e)
     {
         e.ShowError(10);
         return(TestException.GetRoot(e));
     }
     return(null);
 }