Exemple #1
0
        public bool TryOpen(string consoleName, out IIOSource ioSource)
        {
            TerminalWidget terminalWidget = null;

            ApplicationExtensions.InvokeInUIThreadAndWait(() =>
            {
                terminalWidget = new TerminalWidget(() => window.HasFocus);
            });
            ioSource = terminalWidget.IOSource;

            var mre = new ManualResetEventSlim();

            ApplicationExtensions.InvokeInUIThread(() =>
            {
                window                      = new Window();
                window.Title                = consoleName;
                window.Width                = 700;
                window.Height               = 400;
                window.Location             = WindowPositionProvider.Instance.GetNextPosition();
                window.Padding              = new WidgetSpacing();
                window.Content              = terminalWidget;
                terminalWidget.Initialized += mre.Set;
                window.Show();
                window.Closed += (sender, e) =>
                {
                    InnerOnClose();
                };
            });
            mre.Wait();

            return(true);
        }
Exemple #2
0
        public override void AttachTo(T backend)
        {
#if PLATFORM_WINDOWS
            //TODO: after adding support for Windows, remove the ifdef in BitmapImageExtensions.cs
            throw new RecoverableException("Video analyzer is not supported on Windows.");
#else
            base.AttachTo(backend);
            ApplicationExtensions.InvokeInUIThreadAndWait(() => OnAttach(backend));
#endif
        }
Exemple #3
0
 private void StopXwtThread()
 {
     lock (internalLock)
     {
         if (UiThreadId == -1)
         {
             return;
         }
         ApplicationExtensions.InvokeInUIThreadAndWait(Application.Exit);
     }
 }
        public override void Show()
        {
            string tabName;

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

            ApplicationExtensions.InvokeInUIThreadAndWait(() => Emulator.UserInterfaceProvider.ShowAnalyser(this, tabName));
        }
Exemple #5
0
        public void Close()
        {
            var w = window;

            if (w != null)
            {
                ApplicationExtensions.InvokeInUIThreadAndWait(() =>
                {
                    w.Hide();
                });
                w = null;
                return;
            }
        }
Exemple #6
0
        public bool TryOpen(string consoleName, out IIOSource ioSource, bool isMonitorWindow = false)
        {
            TerminalWidget terminalWidget = null;

            ApplicationExtensions.InvokeInUIThreadAndWait(() =>
            {
                terminalWidget = new TerminalWidget(() => window.HasFocus, isMonitorWindow);
            });
            ioSource = terminalWidget.IOSource;

            var mre = new ManualResetEventSlim();

            ApplicationExtensions.InvokeInUIThread(() =>
            {
                window = new Window();
#if PLATFORM_WINDOWS
                window.Icon = Xwt.Drawing.Image.FromResource("renode_nobg.ico");
#endif
                window.Title = consoleName == null ? "Renode" : consoleName;
                // while these minimal values are not sane, we assume it's up to the user to decide
                window.Width                = ConfigurationManager.Instance.Get("termsharp", "window-width", 700, x => x >= 0);
                window.Height               = ConfigurationManager.Instance.Get("termsharp", "window-height", 400, x => x >= 0);
                var windowLocation          = WindowPositionProvider.Instance.GetNextPosition();
                window.Location             = windowLocation;
                window.Padding              = new WidgetSpacing();
                window.Content              = terminalWidget;
                terminalWidget.Initialized += mre.Set;
                window.Show();
                // window.Show() sets Location off screen if scaling > 100% on Windows
                window.Location = windowLocation;
                window.Closed  += (sender, e) =>
                {
                    InnerOnClose();
                };
            });
            mre.Wait();

            return(true);
        }
Exemple #7
0
        public bool TryOpen(string consoleName, out IIOSource ioSource)
        {
            TerminalWidget terminalWidget = null;

            ApplicationExtensions.InvokeInUIThreadAndWait(() =>
            {
                terminalWidget = new TerminalWidget(() => window.HasFocus);
            });
            ioSource = terminalWidget.IOSource;

            var mre = new ManualResetEventSlim();

            ApplicationExtensions.InvokeInUIThread(() =>
            {
                window = new Window();
#if PLATFORM_WINDOWS
                window.Icon = Xwt.Drawing.Image.FromResource("renode_nobg.ico");
#endif
                window.Title                = consoleName == null ? "Renode" : consoleName;
                window.Width                = 700;
                window.Height               = 400;
                var windowLocation          = WindowPositionProvider.Instance.GetNextPosition();
                window.Location             = windowLocation;
                window.Padding              = new WidgetSpacing();
                window.Content              = terminalWidget;
                terminalWidget.Initialized += mre.Set;
                window.Show();
                // window.Show() sets Location off screen if scaling > 100% on Windows
                window.Location = windowLocation;
                window.Closed  += (sender, e) =>
                {
                    InnerOnClose();
                };
            });
            mre.Wait();

            return(true);
        }
 public override void AttachTo(T backend)
 {
     base.AttachTo(backend);
     ApplicationExtensions.InvokeInUIThreadAndWait(() => OnAttach(backend));
 }
 public override void Hide()
 {
     ApplicationExtensions.InvokeInUIThreadAndWait(() => Emulator.UserInterfaceProvider.HideAnalyser(this));
 }