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 ); }
private void HandleInspectCommand(object sender, ExecutedRoutedEventArgs e) { TMWindowInfo window = (TMWindowInfo)this.windowsView.CurrentItem; if (window != null) { window.Snoop(); } }
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 ); }
public TMAttachFailedHandler(TMWindowInfo window, AppChooserExperience appChooserExperience = null) { window.AttachFailed += OnSnoopAttachFailed; _appChooserExperience = appChooserExperience; }
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(); }