コード例 #1
0
        public void Refresh()
        {
            this.windows.Clear();

            Dispatcher.BeginInvoke
            (
                System.Windows.Threading.DispatcherPriority.Loaded,
                (DispatcherOperationCallback)delegate
                {
                    try
                    {
                        Mouse.OverrideCursor = Cursors.Wait;

                        foreach (IntPtr windowHandle in NativeMethods.ToplevelWindows)
                        {
                            TMWindowInfo window = new TMWindowInfo(windowHandle);
                            if (window.IsValidProcess && !this.HasProcess(window.OwningProcess))
                            {
                                new TMAttachFailedHandler(window, this);
                                this.windows.Add(window);
                            }
                        }

                        if (this.windows.Count > 0)
                            this.windowsView.MoveCurrentTo(this.windows[0]);
                    }
                    finally
                    {
                        Mouse.OverrideCursor = null;
                    }
                    return null;
                },
                null
            );
        }
コード例 #2
0
        private void HandleInspectCommand(object sender, ExecutedRoutedEventArgs e)
        {
            TMWindowInfo window = (TMWindowInfo)this.windowsView.CurrentItem;

            if (window != null)
            {
                window.Snoop();
            }
        }
コード例 #3
0
        public void Refresh()
        {
            this.windows.Clear();

            Dispatcher.BeginInvoke
            (
                System.Windows.Threading.DispatcherPriority.Loaded,
                (DispatcherOperationCallback) delegate
            {
                try
                {
                    Mouse.OverrideCursor = Cursors.Wait;

                    foreach (IntPtr windowHandle in NativeMethods.ToplevelWindows)
                    {
                        TMWindowInfo window = new TMWindowInfo(windowHandle);
                        if (window.IsValidProcess && !this.HasProcess(window.OwningProcess))
                        {
                            new TMAttachFailedHandler(window, this);
                            this.windows.Add(window);
                        }
                    }

                    if (this.windows.Count > 0)
                    {
                        this.windowsView.MoveCurrentTo(this.windows[0]);
                    }
                }
                finally
                {
                    Mouse.OverrideCursor = null;
                }
                return(null);
            },
                null
            );
        }
コード例 #4
0
 public TMAttachFailedHandler(TMWindowInfo window, AppChooserExperience appChooserExperience = null)
 {
     window.AttachFailed  += OnSnoopAttachFailed;
     _appChooserExperience = appChooserExperience;
 }
コード例 #5
0
 private void HandleRefreshCommand(object sender, ExecutedRoutedEventArgs e)
 {
     // clear out cached process info to make the force refresh do the process check over again.
     TMWindowInfo.ClearCachedProcessInfo();
     this.Refresh();
 }
コード例 #6
0
 public TMAttachFailedHandler(TMWindowInfo window, AppChooserExperience appChooserExperience = null)
 {
     window.AttachFailed += OnSnoopAttachFailed;
     _appChooserExperience = appChooserExperience;
 }