Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="info"></param>
 public void RestoreState(SerializationInfoEx info)
 {
     Guid     = info.GetValue <Guid>("guid");
     Location = info.GetValue <Point>("location");
     Text     = info.GetString("text");
     Name     = info.GetString("name");
     Dock     = info.GetValue <DockStyle>("dock");
     Size     = info.GetValue <Size>("size");
     if (info.ContainsValue("showDragStrip"))
     {
         ShowDragStrip = info.GetBoolean("showDragStrip");
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Load state.
        /// </summary>
        /// <param name="state"></param>
        public void LoadState(SerializationInfoEx state)
        {
            if (state.ContainsValue("_stringFilter"))
            {
                StringTracerFilter stringFilter = state.GetValue <StringTracerFilter>("_stringFilter");
                if (_stringFilter != null)
                {
                    _stringFilter.CopyDataFrom(stringFilter);
                }
            }

            if (state.ContainsValue("_stringInputFilter"))
            {
                StringTracerFilter stringInputFilter = state.GetValue <StringTracerFilter>("_stringInputFilter");
                if (_stringInputFilter != null)
                {
                    _stringInputFilter.CopyDataFrom(stringInputFilter);
                }
            }

            WinFormsHelper.DirectOrManagedInvoke(this, UpdateFiltersUI);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Restore state of controls. Controls are created and left invisible untill assigned.
        /// </summary>
        /// <param name="info"></param>
        public void RestoreState(SerializationInfoEx info)
        {
            // Clear off any existing drag control from any area.
            DockStyle[] values = (DockStyle[])Enum.GetValues(typeof(DockStyle));
            foreach (DockStyle style in values)
            {
                foreach (DragControl control in GetAreaControls(style))
                {
                    RemoveDragControl(control);
                }
            }

            // Restore draggable controls.
            foreach (DockStyle style in values)
            {
                string fieldName = style.ToString() + "Infos";
                if (info.ContainsValue(fieldName) == false)
                {
                    continue;
                }
                List <SerializationInfoEx> infos = info.GetValue <List <SerializationInfoEx> >(fieldName);
                foreach (SerializationInfoEx controlInfo in infos)
                {
                    DragControl control = new DragControl();
                    control.RestoreState(controlInfo);
                    control.Visible = false;
                    AddDragControl(control);

                    if (style != DockStyle.None)
                    {
                        DockControl(control, style);
                    }
                }
            }

            // Restore panes.
            RestorePanelState(info, panelTop);
            RestorePanelState(info, panelBottom);
            RestorePanelState(info, panelLeft);
            RestorePanelState(info, panelRight);
            RestorePanelState(info, panelCenter);
        }
        /// <summary>
        ///
        /// </summary>
        public void RestoreState(SerializationInfoEx info)
        {
            dragContainerControl.ClearControls();

            dragContainerControl.RestoreState(info);

            //dragContainerControl.ClearControls();

            if (info.ContainsValue("combinedContainerControl.ShowComponentsTitles"))
            {
                toolStripButtonTitlesText.Checked = info.GetBoolean("combinedContainerControl.ShowComponentsTitles");
            }

            // Establish the CheckedControlContainer
            if (info.ContainsValue("combinedContainerControl.CheckedControlContainerGuid"))
            {
                Guid guid = info.GetValue <Guid>("combinedContainerControl.CheckedControlContainerGuid");
                _checkedControlContainer = dragContainerControl.GetDragControlByGuid(guid);
                if (_checkedControlContainer != null)
                {
                    _checkedControlContainer.ShowDragStrip = false;
                }
            }
        }