Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
        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();
            }
        }
Esempio n. 3
0
        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();
            }
        }
Esempio n. 4
0
        private void CloseActiveConnection()
        {
            if (activeConnection == null)
            {
                return;
            }

            activeConnection.Dispose();
            activeConnection = null;
        }