Beispiel #1
0
        public void Show(bool focus, bool immediate)
        {
            if (VsWindowFrame == null)
            {
                return;
            }

            if (immediate)
            {
                _services.MainThread().Assert();
                if (focus)
                {
                    ErrorHandler.ThrowOnFailure(VsWindowFrame.Show());
                    Component.Control?.Focus();
                }
                else
                {
                    ErrorHandler.ThrowOnFailure(VsWindowFrame.ShowNoActivate());
                }
            }
            else
            {
                _services.MainThread().Post(() => {
                    if (focus)
                    {
                        ErrorHandler.ThrowOnFailure(VsWindowFrame.Show());
                        Component.Control?.Focus();
                    }
                    else
                    {
                        ErrorHandler.ThrowOnFailure(VsWindowFrame.ShowNoActivate());
                    }
                });
            }
        }
        public void Show(bool focus, bool immediate)
        {
            if (VsWindowFrame == null)
            {
                return;
            }

            if (immediate)
            {
                VsAppShell.Current.AssertIsOnMainThread();
                if (focus)
                {
                    ErrorHandler.ThrowOnFailure(VsWindowFrame.Show());
                    Component.Control?.Focus();
                }
                else
                {
                    ErrorHandler.ThrowOnFailure(VsWindowFrame.ShowNoActivate());
                }
            }
            else
            {
                VsAppShell.Current.DispatchOnUIThread(() => {
                    if (focus)
                    {
                        ErrorHandler.ThrowOnFailure(VsWindowFrame.Show());
                        Component.Control?.Focus();
                    }
                    else
                    {
                        ErrorHandler.ThrowOnFailure(VsWindowFrame.ShowNoActivate());
                    }
                });
            }
        }