public void ShowText(byte deviceId, string text)
        {
            lock (operationLock)
            {
                logger.Debug("show text [device: {0}; text: {1}]", deviceId, text);

                CloseActiveConnection();

                var connection = GetConnectionForDevice(deviceId);
                if (connection == null)
                {
                    return;
                }

                connection.ShowText(deviceId, text);

                activeConnection = connection;
                CloseActiveConnection();
            }
        }
        public void ShowLines(byte deviceId, ushort[][] lines)
        {
            lock (operationLock)
            {
                logger.Debug("show lines [device: {0}; lines: {1}]", deviceId, lines.Length);

                CloseActiveConnection();

                var connection = GetConnectionForDevice(deviceId);
                if (connection == null)
                {
                    return;
                }

                connection.ShowLines(deviceId, lines);

                activeConnection = connection;
                CloseActiveConnection();
            }
        }
        public void ClearText(byte deviceId)
        {
            lock (operationLock)
            {
                logger.Debug("clear text [device: {0}]", deviceId);

                CloseActiveConnection();

                var connection = GetConnectionForDevice(deviceId);
                if (connection == null)
                {
                    return;
                }

                connection.Clear(deviceId);

                activeConnection = connection;
                CloseActiveConnection();
            }
        }
        private void CloseActiveConnection()
        {
            if (activeConnection == null)
            {
                return;
            }

            activeConnection.Dispose();
            activeConnection = null;
        }