Пример #1
0
        internal void Initialize(IProgressMonitor monitor)
        {
            monitor.BeginTask(GettextCatalog.GetString("Initializing Main Window"), 4);
            try {
                Counters.Initialization.Trace("Creating DefaultWorkbench");
                workbench = new DefaultWorkbench();
                monitor.Step(1);

                Counters.Initialization.Trace("Initializing Workspace");
                workbench.InitializeWorkspace();
                monitor.Step(1);

                Counters.Initialization.Trace("Initializing Layout");
                workbench.InitializeLayout();
                monitor.Step(1);

                ((Gtk.Window)workbench).Visible          = false;
                workbench.ActiveWorkbenchWindowChanged  += OnDocumentChanged;
                IdeApp.Workspace.StoringUserPreferences += OnStoringWorkspaceUserPreferences;
                IdeApp.Workspace.LoadingUserPreferences += OnLoadingWorkspaceUserPreferences;

                IdeApp.CommandService.ApplicationFocusOut += delegate(object o, EventArgs args) {
                    SaveFileStatus();
                };
                IdeApp.CommandService.ApplicationFocusIn += delegate(object o, EventArgs args) {
                    CheckFileStatus();
                };

                pads = null;                    // Make sure we get an up to date pad list.
                monitor.Step(1);
            } finally {
                monitor.EndTask();
            }
        }
Пример #2
0
        internal void EnsureLayout()
        {
            if (!hasEverBeenShown)
            {
                Realize();
                workbench.InitializeWorkspace();
                workbench.InitializeLayout();
                statusBar.Attach(workbench.StatusBar);

                workbench.CurrentLayout = "Solution";

                // now we have an layout set notify it
                if (LayoutChanged != null)
                {
                    LayoutChanged(this, EventArgs.Empty);
                }

                hasEverBeenShown = true;
            }
            else if (!RootWindow.Visible)
            {
                // restore memento if the root window has been hidden before
                var memento = IdeApp.Preferences.WorkbenchMemento.Value;
                workbench.Memento = memento;
            }
        }
Пример #3
0
        internal async Task Initialize(ProgressMonitor monitor)
        {
            monitor.BeginTask(GettextCatalog.GetString("Initializing Main Window"), 4);
            try {
                monitors = (IdeProgressMonitorManager)await Runtime.GetService <ProgressMonitorManager> ();

                documentManager = await Runtime.GetService <DocumentManager> ();

                await Runtime.GetService <DocumentModelRegistry> ();

                await Runtime.GetService <DocumentControllerService> ();

                Counters.Initialization.Trace("Creating DefaultWorkbench");
                workbench = (DefaultWorkbench)await Runtime.GetService <IShell> ();

                monitor.Step(1);

                Counters.Initialization.Trace("Initializing Workspace");
                workbench.InitializeWorkspace();
                monitor.Step(1);

                Counters.Initialization.Trace("Initializing Layout");
                workbench.InitializeLayout();
                monitor.Step(1);

                ((Gtk.Window)workbench).Visible          = false;
                workbench.WorkbenchTabsChanged          += WorkbenchTabsChanged;
                IdeApp.Workspace.StoringUserPreferences += OnStoringWorkspaceUserPreferences;
                IdeApp.Workspace.LoadingUserPreferences += OnLoadingWorkspaceUserPreferences;

                IdeApp.FocusOut += delegate(object o, EventArgs args) {
                    if (!fileEventsFrozen)
                    {
                        fileEventsFrozen = true;
                        FileService.FreezeEvents();
                    }
                };
                IdeApp.FocusIn += delegate(object o, EventArgs args) {
                    if (fileEventsFrozen)
                    {
                        fileEventsFrozen = false;
                        FileService.ThawEvents();
                    }
                };

                pads = null;                    // Make sure we get an up to date pad list.
                monitor.Step(1);
            } finally {
                monitor.EndTask();
            }
        }