コード例 #1
0
ファイル: MainWindowControl.cs プロジェクト: imanadib/dnSpy
        public void Initialize(IStackedContentChild mainChild, MainWindowControlState state)
        {
            horizontalContent.AddChild(verticalContent);
            verticalContent.AddChild(mainChild, StackedContentChildInfo.CreateVertical(new GridLength(1, GridUnitType.Star), 30));

            foreach (var kv in state.SavedLocations)
            {
                savedLocations[kv.Key] = kv.Value;
            }

            if (state.LeftState != null && state.RightState != null && state.TopState != null && state.BottomState != null)
            {
                state.LeftState.Restore(this, toolWindowUIs[AppToolWindowLocation.Left]);
                state.RightState.Restore(this, toolWindowUIs[AppToolWindowLocation.Right]);
                state.TopState.Restore(this, toolWindowUIs[AppToolWindowLocation.Top]);
                state.BottomState.Restore(this, toolWindowUIs[AppToolWindowLocation.Bottom]);
            }
            else
            {
                RestoreDefault();
            }

            if (state.HorizontalContentState != null && state.VerticalContentState != null)
            {
                horizontalContent.State = state.HorizontalContentState;
                verticalContent.State   = state.VerticalContentState;
            }
        }
コード例 #2
0
        public Window InitializeMainWindow()
        {
            var sc = new StackedContent <IStackedContentChild>(false);

            sc.AddChild(appToolBar, StackedContentChildInfo.CreateVertical(new GridLength(0, GridUnitType.Auto)));
            sc.AddChild(stackedContent, StackedContentChildInfo.CreateVertical(new GridLength(1, GridUnitType.Star)));
            sc.AddChild(statusBar, StackedContentChildInfo.CreateVertical(new GridLength(0, GridUnitType.Auto)));
            mainWindow = new MainWindow(themeManager, imageManager, sc.UIObject);
            AddTitleInfo(IntPtr.Size == 4 ? "x86" : "x64");
            wpfCommandManager.Add(ControlConstants.GUID_MAINWINDOW, mainWindow);
            new SavedWindowStateRestorer(mainWindow, uiSettings.SavedWindowState, DefaultWindowLocation);
            mainWindow.Closing          += MainWindow_Closing;
            mainWindow.Closed           += MainWindow_Closed;
            mainWindow.GotKeyboardFocus += MainWindow_GotKeyboardFocus;
            RefreshToolBar();
            return(mainWindow);
        }