private void CriaElementoFila(int numElement) { var el = new QueueElement(); el.Data = textBox3.Text; Canvas.SetLeft(el, canvas3.ActualWidth + 60); canvas3.Children.Add(el); var duration = new Duration(TimeSpan.FromSeconds(0.2)); var da1 = new DoubleAnimation(numElement * 58, duration); da1.DecelerationRatio = 1; el.BeginAnimation(Canvas.LeftProperty, da1); }
public void Enqueue(T value) { var newElement = new QueueElement <T>(value); if (IsEmpty()) { _head = _tail = newElement; } else { _tail.Previous = newElement; _tail = newElement; } }
public T Dequeue() { if (IsEmpty()) { throw new InvalidOperationException("The queue is empty."); } T value = _head.Value; _head = _head.Previous; if (_head == null) { _tail = null; } return(value); }
public Queue() { _head = null; _tail = null; }