Beispiel #1
0
        private void CreateDockContents()
        {
            var theWorkspace = Workbench.MainWorkspace as MockWorkspace;

            foreach (var item in theWorkspace.MainControls)
            {
                var newContent = new DockContentEx(item.Value, item.Key.Title);
                newContent.CloseButtonVisible = true;
                newContent.Icon              = item.Key.DefaultIcon;
                newContent.PartAttribute     = item.Key;
                newContent.PersistString     = item.Key.ID;
                newContent.DefaultDockState  = ShellHelper.Convert(item.Key.Dock);
                newContent.DefaultAlignment  = ShellHelper.Convert(item.Key.Alignment);
                newContent.DefaultProportion = item.Key.Proportion;

                _dockContents[item.Key] = newContent;
            }
        }
Beispiel #2
0
        public void UpdateDockContents()
        {
            DockContentEx firstContentToShow = null;

            foreach (var item in _dockContents)
            {
                if (firstContentToShow == null && item.Value.DefaultDockState == DockState.Document)
                {
                    firstContentToShow = item.Value;
                }

                item.Value.Show(_dockPanel, item.Value.DefaultDockState);
            }

            if (firstContentToShow != null)
            {
                firstContentToShow.Show();
            }
        }