Esempio n. 1
0
        private void OnConnectionState(NuimoConnectionState nuimoConnectionState)
        {
            string buttonTitle;

            switch (nuimoConnectionState)
            {
            case NuimoConnectionState.Disconnected: buttonTitle = "Connect"; break;

            case NuimoConnectionState.Connecting: buttonTitle = "Connecting..."; break;

            case NuimoConnectionState.Connected:
                buttonTitle = "Disconnect";
                var matrixString = " *     * ***   *** *     *             ***     *   *    *   *    *   *     ***   ";
                _nuimoController?.DisplayLedMatrixAsync(new NuimoLedMatrix(matrixString));
                break;

            case NuimoConnectionState.Disconnecting: buttonTitle = "Disconnecting..."; break;

            default: buttonTitle = ""; break;
            }

            ShowToastNotification("Connection State changed", nuimoConnectionState.ToString());



            ConnectButton.Content         = buttonTitle;
            ConnectionStateTextBlock.Text = nuimoConnectionState.ToString();
        }
        private void OnConnectionState(NuimoConnectionState nuimoConnectionState)
        {
            string buttonTitle;

            switch (nuimoConnectionState)
            {
            case     NuimoConnectionState.Disconnected:  buttonTitle = "Connect";          break;

            case     NuimoConnectionState.Connecting:    buttonTitle = "Connecting...";    break;

            case     NuimoConnectionState.Connected:     buttonTitle = "Disconnect";       break;

            case     NuimoConnectionState.Disconnecting: buttonTitle = "Disconnecting..."; break;

            default: buttonTitle = "";                                                 break;
            }
            ConnectButton.Content         = buttonTitle;
            ConnectionStateTextBlock.Text = nuimoConnectionState.ToString();
        }