private static void DeserializeControls(IEnumerator dataEnumerator, IEnumerator <IDockingControl> controlEnumerator) { while (dataEnumerator.MoveNext() && controlEnumerator.MoveNext()) { DockingControl control = controlEnumerator.Current as DockingControl; DockingControlData data = dataEnumerator.Current as DockingControlData; control.Cancelled = data.Cancelled; switch (data.DockingType) { case DockingType.Floating: control.FloatControl(data.FloatingBounds); break; case DockingType.Left: case DockingType.Right: case DockingType.Top: case DockingType.Bottom: control.DockControl(data.PanelIndex, data.DockingIndex, data.DockingType); control.AutoHide = data.AutoHide; break; default: break; } } }
private static void SetDockedDimensions(IEnumerator dataEnumerator, IEnumerator <IDockingControl> controlEnumerator) { dataEnumerator.Reset(); controlEnumerator.Reset(); while (dataEnumerator.MoveNext() && controlEnumerator.MoveNext()) { DockingControl control = controlEnumerator.Current as DockingControl; DockingControlData data = dataEnumerator.Current as DockingControlData; switch (data.DockingType) { case DockingType.Left: case DockingType.Right: case DockingType.Top: case DockingType.Bottom: control.DockedDimension = data.DockedDimension; break; default: break; } } }