Example #1
0
 public void ChangePriority(int priority)
 {
     if (this.Priority != priority)
     {
         this.Priority = priority;
         PriorityChanged?.Invoke(this);
     }
 }
 public TaskManagerViewModel(Action <ProcessPriorityClass?> selectRadio)
 {
     _selectRadio       = selectRadio;
     ProcessList        = new ObservableCollection <ProcessListItem>(Process.GetProcesses().Select(p => new ProcessListItem(p)));
     SelectedProcess    = ProcessList[0];
     PriorityChanged    = new PriorityChanged(this);
     RefreshList        = new RefreshList(this);
     DeleteProcess      = new DeleteProcess();
     RunProcess         = new RunProcess();
     UpdateSpeedChanged = new UpdateSpeedChanged(async(r) =>
     {
         _refreshRate = r;
         await StartRefresh();
     });
 }
 private void OnPriorityChanged()
 {
     PriorityChanged?.Invoke(this, EventArgs.Empty);
 }
Example #4
0
 //For test purposes, we do this manually.
 //Normally this is done automatically, but we do it manually
 //to test prioritylist behavior when the item is temporarily
 //in a transition state.
 public void FirePriorityChanged()
 {
     PriorityChanged?.Invoke(this, EventArgs.Empty);
 }
Example #5
0
 private void OnPropertyValueChanged()
 {
     PriorityChanged?.Invoke();
     PropertyValueChanged?.Invoke();
 }
Example #6
0
		/// <summary>
		///     Raises the <see cref="PriorityChanged" /> event.
		/// </summary>
		/// <seealso cref="EventArgs" />
		protected virtual void OnPriorityChanged()
		{
			PriorityChanged?.Invoke(this, EventArgs.Empty);
		}