private void CheckStack() { if (_orbStack.Count == _stackSize) { stackFull.Invoke(StackProcessor.GetId(_orbStack)); _orbStack.Clear(); } }
public void Push(T obj) { data.Add(obj); if (StackEvent != null) { StackEvent.Invoke(this, new StackEventData <T> { IsPushed = true, Value = obj }); } }
public T Pop() { if (data.Count == 0) { throw new InvalidOperationException(); } var result = data[data.Count - 1]; if (StackEvent != null) { StackEvent.Invoke(this, new StackEventData <T> { IsPushed = false, Value = result }); } return(result); }
public void Publish(object sender, TEventArgs eventArg) { StackEvent?.Invoke(sender, eventArg); }