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); }
//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); }
private void OnPropertyValueChanged() { PriorityChanged?.Invoke(); PropertyValueChanged?.Invoke(); }
/// <summary> /// Raises the <see cref="PriorityChanged" /> event. /// </summary> /// <seealso cref="EventArgs" /> protected virtual void OnPriorityChanged() { PriorityChanged?.Invoke(this, EventArgs.Empty); }