Ejemplo n.º 1
0
        /// <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;
        }
Ejemplo n.º 2
0
        /// <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;
            }
        }