Beispiel #1
0
        private static void SetLayoutXml(this LayoutControl layoutControl, string xml)
        {
            using (var stream = new MemoryStream())
            {
                using (var writer = new StreamWriter(stream))
                {
                    layoutControl.BeginInit();
                    layoutControl.BeginUpdate();
                    try
                    {
                        writer.Write(xml);
                        writer.Flush();
                        stream.Seek(0, SeekOrigin.Begin);

                        layoutControl.RestoreLayoutFromStream(stream);
                    }
                    finally
                    {
                        layoutControl.EndUpdate();
                        layoutControl.EndInit();
                    }
                }
            }
        }