/// <summary>Saves the settings of this control.</summary> /// <param name="settings">The <see cref="T:SplitContainerSettings"/> to save to.</param> public void SaveSettings(SplitContainerSettings settings) { if (settings == null) throw new ArgumentNullException("settings"); settings.CollapsedPanel = Panel1Collapsed ? FixedPanel.Panel1 : Panel2Collapsed ? FixedPanel.Panel2 : FixedPanel.None; if (!(Panel1Collapsed || Panel2Collapsed)) settings.SplitterDistance = SplitterDistance; }
/// <summary>Loads the settings of this control.</summary> /// <param name="settings">The <see cref="T:SplitContainerSettings"/> to load from.</param> public void LoadSettings(SplitContainerSettings settings) { if (settings == null) throw new ArgumentNullException("settings"); if (settings.SplitterDistance > 0) SplitterDistance = settings.SplitterDistance; switch (settings.CollapsedPanel) { case FixedPanel.Panel1: Panel1Collapsed = true; break; case FixedPanel.Panel2: Panel2Collapsed = true; break; } }