Beispiel #1
0
        private void InitializeLayout(string name)
        {
            if (!this.layouts.Contains(name))
            {
                this.layouts.Add(name);
            }
            if (((IEnumerable <string>) this.dock.Layouts).Contains <string>(name))
            {
                return;
            }
            this.dock.CreateLayout(name, true);
            this.dock.CurrentLayout       = name;
            this.documentDockItem.Visible = true;
            HashSet <string> stringSet = new HashSet <string>();

            foreach (PadCodon padContent in this.padContentCollection)
            {
                if (!stringSet.Contains(padContent.PadId) && padContent.DefaultLayouts != null && (padContent.DefaultLayouts.Contains("DefaultLayout") || padContent.DefaultLayouts.Contains("*")))
                {
                    DockItem dockItem = this.dock.GetItem(padContent.PadId);
                    if (dockItem != null)
                    {
                        dockItem.Visible = true;
                        if (!string.IsNullOrEmpty(padContent.DefaultPlacement))
                        {
                            dockItem.SetDockLocation(this.ToDockLocation(padContent.DefaultPlacement));
                        }
                        dockItem.Status = padContent.DefaultStatus;
                        stringSet.Add(padContent.PadId);
                    }
                }
            }
            foreach (DockItem dockItem in this.dock.GetItems())
            {
                if (!stringSet.Contains(dockItem.Id) && (dockItem.Behavior & DockItemBehavior.Sticky) == DockItemBehavior.Normal && dockItem != this.documentDockItem)
                {
                    dockItem.Visible = false;
                }
            }
        }