Ejemplo n.º 1
0
        /// <summary>Loads the window layout.</summary>
        /// <param name="layout">The specified <see cref="DockLayout"/> instance.</param>
        /// <param name="loadDockItemCallback">Callback to load <see cref="DockItem"/>. This callback
        /// takes an <see cref="object"/> returned by <see cref="DockItem.Save">DockItem.Save</see> method, returns an
        /// <see cref="DockItem"/> instance.</param>
        /// <remarks>Calling this method will clear all undo stack.</remarks>
        /// <exception cref="ArgumentNullException"><paramref name="layout"/> is <see langword="null"/>.</exception>
        /// <exception cref="InvalidOperationException">The <see cref="DockItems"/> collection is not empty. Close all <see cref="DockItem"/> before calling <see cref="Load"/>.</exception>
        public void Load(DockLayout layout, Func <object, DockItem> loadDockItemCallback)
        {
            if (layout == null)
            {
                throw new ArgumentNullException("layout");
            }

            if (DockItems.Count != 0)
            {
                throw new InvalidOperationException(SR.Exception_DockControl_Load_DockItemsNotEmpty);
            }

            DockLayoutAdapter.Load(this, layout, loadDockItemCallback);
            ClearUndo();
        }
Ejemplo n.º 2
0
 /// <summary>Saves the current window layout.</summary>
 /// <returns>The saved <see cref="DockLayout"/>.</returns>
 public DockLayout Save()
 {
     return(DockLayoutAdapter.Save(this));
 }