/// <summary> /// Creates a progress description without definable end. /// </summary> public ProgressDescription(UpdateDescription currentUpdate = null) { Count = null; CurrentIndex = null; CurrentUpdate = currentUpdate; IsIndeterminate = (Count == null) ? true : false; }
public override bool Equals(object obj) { UpdateDescription other = obj as UpdateDescription; if (other == null) { return(false); } if (object.ReferenceEquals(this, other)) { return(true); } if (string.IsNullOrEmpty(ID)) { return(false); } return(ID.Equals(other.ID)); }
/// <summary> /// Creates a progress description with definable end. /// </summary> public ProgressDescription(UpdateDescription currentUpdate, int currentIndex, int count, int percent) { if (count <= 0) { throw new IndexOutOfRangeException($"{nameof(count)} must be greater than zero."); } if (currentIndex < 0 || (currentIndex >= count)) { throw new IndexOutOfRangeException($"{nameof(currentIndex)} must be positive and smaller than {nameof(count)}."); } if (percent < 0 || percent > 100) { throw new IndexOutOfRangeException($"{nameof(percent)} must be between 0 and 100."); } Count = count; CurrentIndex = currentIndex; CurrentUpdate = currentUpdate; IsIndeterminate = (Count == null) ? true : false; Percent = percent; }