private void SaveLayoutToStream(Stream stream) { object state = _form.BeginSavingLayout(); try { Layout layout = _form.GetLayout(); LayoutUtil.LayoutToStream(layout, stream); } finally { _form.EndSavingLayout(state); } }
private void LoadLayoutFromStream(Stream stream) { object state = _form.BeginLoadingLayout(); try { _form.ApplyLayout(LayoutUtil.StreamToLayout(stream) ?? Layout.Default); _form.BeginSorting(); SortBy(); } finally { _form.EndLoadingLayout(state); } }