Esempio n. 1
0
        private async Task LoadConsoleEditorAsync()
        {
            try
            {
                if (WpfConsole != null)
                {
                    // allow the console to start writing output
                    WpfConsole.StartWritingOutput();

                    var consolePane = WpfConsole.Content as FrameworkElement;

                    await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

                    ConsoleParentPane.AddConsoleEditor(consolePane);

                    // WPF doesn't handle input focus automatically in this scenario. We
                    // have to set the focus manually, otherwise the editor is displayed but
                    // not focused and not receiving keyboard inputs until clicked.
                    if (consolePane != null)
                    {
                        PendingMoveFocus(consolePane);
                    }
                }
            }
            catch (Exception x)
            {
                ExceptionHelper.WriteErrorToActivityLog(x);
            }
        }
Esempio n. 2
0
        private void LoadConsoleEditor()
        {
            if (WpfConsole != null)
            {
                FrameworkElement consolePane = WpfConsole.Content as FrameworkElement;
                ConsoleParentPane.AddConsoleEditor(consolePane);

                // WPF doesn't handle input focus automatically in this scenario. We
                // have to set the focus manually, otherwise the editor is displayed but
                // not focused and not receiving keyboard inputs until clicked.
                if (consolePane != null)
                {
                    PendingMoveFocus(consolePane);
                }
            }
        }