private void radioButton3_CheckedChanged(object sender, EventArgs e) { if (radioButton3.Checked) { totalTraveled = 0; //resets the value of totalTraveled this.seekInstance = new Elevator(); //assigns the Elevator implementation to seekInstance totalTraveled = this.seekInstance.seek(currentList, currentQueue, startingPosition); this.Reset(); if (totalTraveled != 0) { listBox1.Items.Add("Elevator travel distance: " + totalTraveled); } //checks if the method has been completed and returned a non-null value for the travel distance else { MessageBox.Show("An error occured when using Elevator"); } } }
/// <summary> /// Reset the cursor associated with the consumer or reader to a specific message publish time using a DateTimeOffset. /// </summary> public static async ValueTask Seek(this ISeek seeker, DateTimeOffset publishTime, CancellationToken cancellationToken = default) => await seeker.Seek((ulong)publishTime.ToUnixTimeMilliseconds(), cancellationToken).ConfigureAwait(false);