private void ProcessOptionsChange(object sender, PrioritySchedulerOptionsChangedEventArgs e) { int queueCount = Math.Min(e.NewThreadCountsByPriority.Count, _queuesByPriority.Length); for (int priority = 0; priority < queueCount; priority++) { _queuesByPriority[priority].ThreadCount = e.NewThreadCountsByPriority[priority]; } }
public void ChangeThreadCounts(params int[] newThreadCountsByPriority) { var oldThreadCountsByPriority = ThreadCountsByPriority; ThreadCountsByPriority = newThreadCountsByPriority; var eventArgs = new PrioritySchedulerOptionsChangedEventArgs { OldThreadCountsByPriority = oldThreadCountsByPriority, NewThreadCountsByPriority = newThreadCountsByPriority }; OnChanged(eventArgs); }
protected void OnChanged(PrioritySchedulerOptionsChangedEventArgs eventArgs) { Changed?.Invoke(this, eventArgs); }