// notifies user based on alert settings
public void Notify(int alertIndex)
{
if (MainForm.InvokeRequired)
{
MainForm.BeginInvoke(new Action(() => Notify(alertIndex)));
}
else
{
if (Settings.Default.PlaySound)
{
switch (Sound)
{
case SoundType.looping:
_soundPlayer.PlayLooping();
break;
case SoundType.sound:
_soundPlayer.Play();
break;
}
}
if (ShowWindowsMsg)
{
_popup.ContentText = AbstractAlert.Alerts[alertIndex].Message;
Debug.WriteLine("Called popup: " + Thread.CurrentThread.ManagedThreadId);
_popup.Popup();
}
if (ShowWindow)
{
MainForm.ShowWindow();
}
MainForm.AddMessage(alertIndex);
}
}