public ConsoleWindowBackendAnalyzer()
        {
            preferredTerminal = ConfigurationManager.Instance.Get("general", "terminal", TerminalTypes.Termsharp);
#if EMUL8_PLATFORM_WINDOWS
            if (preferredTerminal != TerminalTypes.Termsharp)
            {
                Logger.LogAs(this, LogLevel.Warning, "Only >>Termsharp<< terminal is available on Windows - forcing to use it.");
            }
#endif
            if (preferredTerminal == TerminalTypes.Termsharp)
            {
                ApplicationExtensions.InvokeInUIThreadAndWait(() =>
                {
                    terminalWidget = new TerminalWidget(() => window.HasFocus);
                });
                IO = terminalWidget.IO;
            }
#if !EMUL8_PLATFORM_WINDOWS
            else
            {
                ptyUnixStream = new PtyUnixStream();
                IO            = new IOProvider(new StreamIOSource(ptyUnixStream));
            }
#endif
        }
        public void Hide()
        {
            var w = window;

            if (w != null)
            {
                ApplicationExtensions.InvokeInUIThreadAndWait(() =>
                {
                    w.Hide();
                });
                w = null;
                return;
            }

            var p = process;

            if (p == null)
            {
                return;
            }

            try
            {
                p.CloseMainWindow();
            }
            catch (InvalidOperationException e)
            {
                // do not report an exception if the problem has already exited
                if (!e.Message.Contains("finished") && !e.Message.Contains("exited"))
                {
                    throw;
                }
            }
            process = null;
        }
Exemplo n.º 3
0
 private void StopXwtThread()
 {
     lock (internalLock)
     {
         if (UiThreadId == -1)
         {
             return;
         }
         ApplicationExtensions.InvokeInUIThreadAndWait(Application.Exit);
     }
 }
Exemplo n.º 4
0
        public override void Show()
        {
            string tabName;

            if (!EmulationManager.Instance.CurrentEmulation.TryGetEmulationElementName(Backend.AnalyzableElement, out tabName))
            {
                tabName = "?";
            }

            ApplicationExtensions.InvokeInUIThreadAndWait(() => Emulator.UserInterfaceProvider.ShowAnalyser(this, tabName));
        }
Exemplo n.º 5
0
 public override void AttachTo(T backend)
 {
     base.AttachTo(backend);
     ApplicationExtensions.InvokeInUIThreadAndWait(() => OnAttach(backend));
 }
Exemplo n.º 6
0
 public override void Hide()
 {
     ApplicationExtensions.InvokeInUIThreadAndWait(() => Emulator.UserInterfaceProvider.HideAnalyser(this));
 }