private void RestoreAutoHideState(AutoHideGroupCollection autoHideGroupCollection)
        {
            if (autoHideGroupCollection == null)
            {
                return;
            }

            foreach (AutoHideGroup group in autoHideGroupCollection)
            {
                foreach (DockWindow window in group.Windows)
                {
                    DockWindowPlaceholder placeholder = window as DockWindowPlaceholder;
                    if (placeholder == null)
                    {
                        continue;
                    }

                    DockWindow actualWindow = owner[placeholder.DockWindowName];
                    if (actualWindow == null)
                    {
                        continue;
                    }

                    owner.AutoHideWindow(actualWindow);
                }
            }
        }
        internal void ClearAutoHideGroups()
        {
            DisposeGroupCollection(this.leftAutoHideGroups);
            DisposeGroupCollection(this.topAutoHideGroups);
            DisposeGroupCollection(this.rightAutoHideGroups);
            DisposeGroupCollection(this.bottomAutoHideGroups);

            this.leftAutoHideGroups   = null;
            this.topAutoHideGroups    = null;
            this.rightAutoHideGroups  = null;
            this.bottomAutoHideGroups = null;
        }
        private void DisposeGroupCollection(AutoHideGroupCollection groups)
        {
            if (groups == null)
            {
                return;
            }

            foreach (AutoHideGroup group in groups)
            {
                foreach (DockWindow window in group.Windows)
                {
                    window.Dispose();
                }
            }
        }
        private void PrepareAutoHideGroups(ref AutoHideGroupCollection autoHideGroupCollection, List <AutoHideGroup> groups)
        {
            if (autoHideGroupCollection == null)
            {
                autoHideGroupCollection = new AutoHideGroupCollection();
            }

            autoHideGroupCollection.Clear();
            foreach (AutoHideGroup group in groups)
            {
                AutoHideGroup serializableGroup = new AutoHideGroup();
                foreach (DockWindow window in group.Windows)
                {
                    DockWindowPlaceholder placeholder = new DockWindowPlaceholder(window);
                    serializableGroup.Windows.Add(placeholder);
                }
                autoHideGroupCollection.Add(serializableGroup);
            }
        }