Esempio n. 1
0
 void RefreshAsync()
 {
     try {
         var finder = new ManagedProcessesFinder();
         foreach (var info in finder.FindAll(cancellationToken.Token))
         {
             AddInfo(info);
         }
     }
     catch (OperationCanceledException) {
     }
     catch {
         //TODO: Show error to user
     }
     ExecInOriginalThread(() => {
         refreshThread = null;
         OnPropertyChanged("IsRefreshing");
     });
 }
Esempio n. 2
0
		void RefreshAsync() {
			try {
				var finder = new ManagedProcessesFinder();
				foreach (var info in finder.FindAll(cancellationToken))
					AddInfo(info);
			}
			catch (OperationCanceledException) {
			}
			catch {
				//TODO: Show error to user
			}
			ExecInOriginalThread(() => {
				refreshThread = null;
				OnPropertyChanged(nameof(IsRefreshing));
			});
		}
Esempio n. 3
0
		void AddInfo(ManagedProcessesFinder.Info info) {
			lock (infoListLock) {
				infoList.Add(info);
				if (infoList.Count == 1)
					ExecInOriginalThread(() => AddDiscoveredProcesses());
			}
		}