public MainForm(SoundQueueConsumer soundQueueConsumer) { _soundQueueConsumer = soundQueueConsumer; DispouseTemplateChangeRx = _soundQueueConsumer.SoundMessageChangeRx.Subscribe(SoundMessageChangeRxEventHandler); DispouseQueueChangeRx = _soundQueueConsumer.QueueChangeRx.Subscribe(QueueChangeRxEventHandler); _soundQueueConsumer.StartQueue(); InitializeComponent(); }
private void btn_StopQueue_Click(object sender, EventArgs e) { if (_stopQueue) { _soundQueueConsumer.StartQueue(); _stopQueue = false; btn_StopQueue.Text = "Stop Queue"; } else { _soundQueueConsumer.StopQueue(); _stopQueue = true; btn_StopQueue.Text = "Start Queue"; } }