Exemplo n.º 1
0
 //Dev
 public void SaveDevLayout(DevExpress.Utils.Serializing.ISupportXtraSerializer dataLayoutControl, string key)
 {
     try
     {
         System.IO.MemoryStream ms = new System.IO.MemoryStream();
         dataLayoutControl.SaveLayoutToStream(ms);
         StreamReader reader = new StreamReader(ms);
         ms.Position = 0;
         string strlayouts = reader.ReadToEnd();
         PropertyService.Set <string>(key, strlayouts);
     }
     catch (Exception ex)
     {
         MessageService.ShowException(ex);
     }
 }
Exemplo n.º 2
0
 public void RestoreDevLayout(DevExpress.Utils.Serializing.ISupportXtraSerializer dataLayoutControl, string key)
 {
     try
     {
         string layout = PropertyService.Get(key);
         if (layout != string.Empty)
         {
             System.IO.MemoryStream ms     = new System.IO.MemoryStream();
             System.IO.StreamWriter writer = new System.IO.StreamWriter(ms);
             writer.AutoFlush = true;
             writer.Write(layout);
             ms.Position = 0;
             dataLayoutControl.RestoreLayoutFromStream(ms);
         }
     }
     catch (Exception ex)
     {
         MessageService.ShowException(ex);
     }
 }