/// <summary> /// Callback for <see cref="PayloadCommand"/> (receiver function) /// </summary> /// <param name="payload"><see cref="PayloadCommand"/></param> private void OnPayloadCommand(PayloadCommand payload) { // cast payload data to MultiThreadingToggle var data = (MultiThreadingToggle)payload.Data; _isMultiThreadingOn = data.IsMultiThreadingOn; // check if multithreading flag is on if (_isMultiThreadingOn) { // start thread queue _threadQueue.Start(); } else { // stop thread queue _threadQueue.Stop(); } }