//-------------------------------------------------------------------------- // Connection state //-------------------------------------------------------------------------- void ConnectionStateHandler(Ugi.ConnectionStates state) { if (Ugi.Singleton().IsConnected) { FindViewById <Button> (Resource.Id.batteryButton).Visibility = ViewStates.Visible; FindViewById <Button> (Resource.Id.configureButton).Visibility = ViewStates.Visible; FindViewById <Button> (Resource.Id.audioReconfigureButton).Visibility = ViewStates.Visible; FindViewById <TextView> (Resource.Id.disconnectedTextView).Visibility = ViewStates.Invisible; } else { FindViewById <Button> (Resource.Id.batteryButton).Visibility = ViewStates.Invisible; FindViewById <Button> (Resource.Id.configureButton).Visibility = ViewStates.Invisible; FindViewById <Button> (Resource.Id.audioReconfigureButton).Visibility = ViewStates.Invisible; FindViewById <TextView> (Resource.Id.disconnectedTextView).Visibility = ViewStates.Visible; TextView tv = FindViewById <TextView> (Resource.Id.disconnectedTextView); if (Ugi.Singleton().ConnectionState == Ugi.ConnectionStates.NotConnected) { tv.Text = "Not Connected"; } else { tv.Text = "Connecting"; } } }
private void ConnectionStateHandler(Ugi.ConnectionStates state) { if (state == Ugi.ConnectionStates.Connected) { ConnectionStateLabel.Text = "Connected"; } else if (state == Ugi.ConnectionStates.Connecting) { ConnectionStateLabel.Text = "Connecting"; } else if (state == Ugi.ConnectionStates.NotConnected) { ConnectionStateLabel.Text = "Disconnected"; } }
//-------------------------------------------------------------------------- // Connection state //-------------------------------------------------------------------------- void ConnectionStateHandler(Ugi.ConnectionStates state) { if (Ugi.Singleton().IsConnected) { batteryButton.Hidden = false; configureButton.Hidden = false; connectionStateLabel.Hidden = true; } else { batteryButton.Hidden = true; configureButton.Hidden = true; connectionStateLabel.Hidden = false; if (Ugi.Singleton().ConnectionState == Ugi.ConnectionStates.NotConnected) { connectionStateLabel.Text = "Not Connected"; } else { connectionStateLabel.Text = "Connecting"; } } }