Beispiel #1
0
        private async void AttachToWindow(HostedWindowItem item)
        {
            try
            {
                await ContainTargetWindow(item);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.ToString());
                TabsContainer.CloseTab(item);
            }

            try
            {
                if (Properties.Settings.Default.TransparentTerminalEnabled)
                {
                    SetWindowOpacity(item.WindowHandle, Properties.Settings.Default.TerminalTransparencyAmount);
                }
            }
            catch { }
        }
Beispiel #2
0
        private async Task CreateTabForWindow(IntPtr handle, string title)
        {
            await Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, (Action)(() =>
            {
                var windowItem = new HostedWindowItem
                {
                    WindowHandle = handle,
                };
                var tabItem = new Model.UI.TabItem
                {
                    IsActive = true,
                    Title = title,
                    HostedWindowItem = windowItem,
                };
                windowItem.TabItem = tabItem;
                this.Title = title;

                TabsContainer.AddTab(tabItem);

                this.ForcePaint();
            }));
        }