private void ReadMessageTimer_Tick(object sender, EventArgs e) { string message = serialMessenger.ReadMessages(); if (message != null && message != "") { processReceivedMessage(message); } }
/// <summary> /// Every tick check read if their are new messages if so process them /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ReadMessageTimer_Tick(object sender, EventArgs e) { string[] messagesLock = serialMessengerlock.ReadMessages(); if (messagesLock != null) { foreach (string message in messagesLock) { processReceivedMessage(message); } } string[] messagesTv = serialMessengerTv.ReadMessages(); if (messagesTv != null) { foreach (string message in messagesTv) { processReceivedMessage(message); } } }