Ejemplo n.º 1
0
 private void ribbonButtonViewCodeSnippets_Click(object sender, EventArgs e)
 {
     if (_codeSnippetsWindow == null || _codeSnippetsWindow.IsDisposed)
     {
         _codeSnippetsWindow = new CodeSnippetsWindow();
         _codeSnippetsWindow.Show(dockPanel, DockState.DockRightAutoHide);
         _codeSnippetsWindow.OnInsertCode += (code) =>
         {
             if (dockPanel.ActiveDocument is EditorWindow)
             {
                 var editorWindow = dockPanel.ActiveDocument as EditorWindow;
                 editorWindow.InsertText(code);
             }
         };
     }
     _codeSnippetsWindow.Show(dockPanel, DockState.DockRight);
 }
Ejemplo n.º 2
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            dockPanel.DockLeftPortion = .20D;
            _outputWindow             = new OutputWindow();
            _outputWindow.Show(dockPanel, DockState.DockBottomAutoHide);

            _connectionBrowserWindow = new ConnectionBrowserWindow();
            _connectionBrowserWindow.Show(dockPanel, DockState.DockLeft);

            _schemaWindow = new SchemaWindow();
            //_schemaWindow.Show(dockPanel, new Rectangle(98, 133, 200, 383));

            _codeSnippetsWindow = new CodeSnippetsWindow();
            _codeSnippetsWindow.Show(dockPanel, DockState.DockRightAutoHide);
            _codeSnippetsWindow.OnInsertCode += (code) =>
            {
                if (dockPanel.ActiveDocument is EditorWindow)
                {
                    var editorWindow = dockPanel.ActiveDocument as EditorWindow;
                    editorWindow.InsertText(code);
                }
            };

            Theme.ColorTable = new MongoSharpTheme();

            WindowManager.Instance.MainForm                = this;
            WindowManager.Instance.MainDockPanel           = dockPanel;
            WindowManager.Instance.HomeRibbonTab           = ribbonTabHome;
            WindowManager.Instance.ClipBoardRibbonPanel    = ribbonPanelClipboard;
            WindowManager.Instance.EditorRibbonPanel       = ribbonPanelEditor;
            WindowManager.Instance.ConnectionBrowserWindow = _connectionBrowserWindow;
            WindowManager.Instance.SchemaWindow            = _schemaWindow;
            WindowManager.Instance.OutputWindow            = _outputWindow;
            WindowManager.Instance.CodeSnippetsWindow      = _codeSnippetsWindow;

            UpdateRecentFiles();
        }