/// <summary>
        ///     Получить настройки для внешнего вида объекта в виде массива байтов
        /// </summary>
        /// <param name="control">Контрол, для которого необходимо получить Layout в виде массива байтов</param>
        /// <returns>Возвращает массив байтов</returns>
        public static byte[] GetLayoutData(this Control control)
        {
            ISupportXtraSerializer sxs = null;
            var gc = control as GridControl;

            if (gc != null)
            {
                sxs = gc.MainView;
            }
            else
            {
                var pv = control as PivotGridControl;
                if (pv != null)
                {
                    sxs = pv;
                }
                else
                {
                    var tl = control as TreeList;
                    if (tl != null)
                    {
                        sxs = tl;
                    }
                }
            }
            if (sxs == null)
            {
                return(null);
            }
            var stream = new MemoryStream();

            sxs.SaveLayoutToStream(stream);
            return(stream.GetBuffer());
        }
 private void SaveLayout(State state, string name, ISupportXtraSerializer serializer)
 {
     using (var stream = new MemoryStream())
     {
         serializer.SaveLayoutToStream(stream);
         stream.Position = 0;
         using (var reader = new StreamReader(stream))
         {
             state[name] = reader.ReadToEnd();
         }
     }
 }
 public void SaveLayoutToStream(System.IO.Stream stream)
 {
     _serializer.SaveLayoutToStream(stream);
 }