void Checked_Changed(object sender, CompoundButton.CheckedChangeEventArgs e) { var checkBox = sender as CheckBox; //get the checkbox that fires the event to get the mapping between checkbox and phrase if (checkBox == null) //if it was not a checkbox that fired the event do nothing { return; } if (e.IsChecked) { checkedIds.Add(checkBox.Id); //you need some identifier to know the mapping between phrase and checkbox. } else { checkedIds.Remove(checkBox.Id); //remove id if checkbox got unchecked } }
private void FireAlert_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (FireAlert.Checked) { Dialog diag = new Dialog(Activity); diag.Window.RequestFeature(WindowFeatures.NoTitle); diag.SetCancelable(false); View v = Activity.LayoutInflater.Inflate(Resource.Layout.Alarm_NewAlarm_FireAlert, null, false); Button ok = v.FindViewById <Button>(Resource.Id.button1); ok.Click += (object sender1, EventArgs e1) => { diag.Cancel(); }; diag.SetContentView(v); diag.Show(); } }
private void RadioEnableOnCheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { try { var isChecked = RadioEnable.Checked; switch (isChecked) { case true: RadioDisable.Checked = false; UsersPost = "1"; break; } } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); } }
private void RbPublicOnCheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { try { var isChecked = RadioPublic.Checked; switch (isChecked) { case true: RadioPrivate.Checked = false; GroupPrivacy = "1"; break; } } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); } }
private void NonVegBox_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (e.IsChecked) { grilledBox.Visibility = tikkaBox.Visibility = sausaga.Visibility = beefBox.Visibility = ViewStates.Visible; } else { grilledBox.Visibility = tikkaBox.Visibility = sausaga.Visibility = beefBox.Visibility = ViewStates.Gone; } if (!e.IsChecked) { selectAllBox.Checked = false; grilledBox.Checked = tikkaBox.Checked = sausaga.Checked = beefBox.Checked = false; } }
private void TvOnCheckedChange(object sender, CompoundButton.CheckedChangeEventArgs checkedChangeEventArgs) { var checkBox = sender as CheckBox; var searchItem = checkBox?.Tag as SearchAdapter.SearchItem; if (searchItem != null) { searchItem.Checked = checkBox.Checked; } if (searchItem != null && !searchItem.Checked) { checkedSearchItems.Remove(searchItem); } else { checkedSearchItems.Add(searchItem); } }
private void RbNewOnCheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { try { var isChecked = RbNew.Checked; switch (isChecked) { case true: RbUsed.Checked = false; ProductType = "0"; break; } } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); } }
private void SwUseInAppRomeProcessOnWindows_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { Settings settings = new Settings(this); settings.UseInAppServiceOnWindowsDevices = e.IsChecked; if (Common.PackageManager != null) { if (settings.UseInAppServiceOnWindowsDevices) { Common.PackageManager.SetAppServiceName("com.roamit.serviceinapp", "com.roamit.service"); } else { Common.PackageManager.SetAppServiceName("com.roamit.service"); } } }
/// <summary> /// Call back for when switch is changed /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">E.</param> private void switchClick(object sender, CompoundButton.CheckedChangeEventArgs e) { Switch s = (Switch)sender; if (s.Checked) { if (!AppConfig.PostSensorUpdates) { if (_connectedDeviceMap.Count > 0) { AppConfig.PostSensorUpdates = true; showLiveView(); populateConnectedDeviceList(); // Resetting status of each device and Notifying foreach (string address in _connectedDeviceMap.Keys.ToList()) { // _connectedDeviceMap[address] = true; AddDevice(address); } } else { Log.Warn(TAG, "No connected devices. Sensor reporting will remain off"); // Disabling check s.Checked = false; // Give message Toast.MakeText(appContext, NO_CONNECTED_DEVICES, ToastLength.Short).Show(); } } } else { if (AppConfig.PostSensorUpdates) { AppConfig.PostSensorUpdates = false; hideLiveView(); PauseSensorReporting(); } } }
private void CheckBox_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (sender is CheckBox) { var checkbox = (CheckBox)sender; string test = checkbox.Id.ToString(); string checkedName = checkbox.Text; if (linearLayout1.FindViewById(checkbox.Id) != null) { CheckSelectedItems(ref SelectedManufacturers, checkedName, checkbox); } else { CheckSelectedItems(ref SelectedPriceRanges, checkedName, checkbox); } } }
private void Rb_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (!e.IsChecked) { return; } ItemHolderRadioButton checkedChangedButton = sender as ItemHolderRadioButton; myButtons.ForEach(rb => { if (rb.Id != checkedChangedButton.Id) { rb.Checked = false; } }); var test = myButtons.Where(b => b.Checked).ToList(); OnCheckedChanged(new CheckedChangeEventArgs(checkedChangedButton.Id)); }
private void SwitchToggled(object sender, CompoundButton.CheckedChangeEventArgs e) { if (e.IsChecked) { ApplicationContext.StartService(new Intent(this, typeof(ApiService))); ISharedPreferencesEditor editor = preferences.Edit(); editor.PutBoolean("notifications_active", true); editor.Apply(); } else { ApplicationContext.StopService(new Intent(this, typeof(ApiService))); ISharedPreferencesEditor editor = preferences.Edit(); editor.PutBoolean("notifications_active", false); editor.Apply(); } }
private void NotificationChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (!(sender is SwitchCompat)) { return; } var subscription = PushSettings.None; if (Equals(sender, _notificationUpvotesSwitch)) { subscription = PushSettings.Upvote; } else if (Equals(sender, _notificationCommentsUpvotesSwitch)) { subscription = PushSettings.UpvoteComment; } else if (Equals(sender, _notificationFollowingSwitch)) { subscription = PushSettings.Follow; } else if (Equals(sender, _notificationCommentsSwitch)) { subscription = PushSettings.Comment; } else if (Equals(sender, _notificationPostingSwitch)) { subscription = PushSettings.User; } else if (Equals(sender, _notificationTransferSwitch)) { subscription = PushSettings.Transfer; } if (e.IsChecked) { PushSettings |= subscription; } else { PushSettings ^= subscription; } }
private void WidgetConfigBackgroundSelector_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (e.IsChecked) { color = (sender as RadioButton).Id switch { Resource.Id.WidgetConfigureBackgroundColorBlack => "000000", _ => "FFFFFF", }; selectedColor = (sender as RadioButton).Id switch { Resource.Id.WidgetConfigureBackgroundColorBlack => "Black", _ => "White" }; UpdatePreviewStyle(); } }
private void MSwitch1_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (mSwitch1.Checked == true) { if (parent.parent.mBTconnected == false) { mTextViews[0].Text = "Bluetooth connect..."; parent.parent.CreateBluetoothConnection(); } } else { if (parent.parent.mBTconnected == true) { mTextViews[0].Text = "Bluetooth disconnect..."; parent.parent.CloseBluetoothConnection(); } } }
void tgOnOff_HandleCheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (e.IsChecked) { Result.Text = String.Empty; dataToSend = new Java.Lang.String("Start"); writeData(dataToSend); // beginListenForData(); } else { Result.Text = String.Empty; dataToSend = new Java.Lang.String("Stop"); writeData(dataToSend); //beginListenForData(); } }
private void CbVolume_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { var buttonView = sender as CheckBox; if (buttonView.Id == cbVolume.Id) { Settings.VolumeFlipEnable = (e.IsChecked); } else if (buttonView.Id == cbAutoBrightness.Id) { if (e.IsChecked) { startAutoLightness(); } else { stopAutoLightness(); } } }
void HandleCheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (e.IsChecked && Player != null) { switch (((Button)sender).Id) { case Resource.Id.style_default: Player.SetPlayerStyle(YouTubePlayerPlayerStyle.Default); break; case Resource.Id.style_minimal: Player.SetPlayerStyle(YouTubePlayerPlayerStyle.Minimal); break; case Resource.Id.style_chromeless: Player.SetPlayerStyle(YouTubePlayerPlayerStyle.Chromeless); break; } } }
//Click do botão void tgConnect_HandleCheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (e.IsChecked) { //entra se clicar no botão Connect(); } else { //se desconectar if (btSocket.IsConnected) { try { btSocket.Close(); } catch (System.Exception ex) { Console.WriteLine(ex.Message); } } } }
public void visible_of_second(object sender, CompoundButton.CheckedChangeEventArgs e) // nastepstwa po wlaczeniu switcha2 { if (pierwszyON) { switch1.Checked = false; } drugiON = e.IsChecked; if (e.IsChecked) { buttom_znak.Text = "znak"; buttom_znak.Visibility = ViewStates.Visible; txt2.Visibility = ViewStates.Visible; } else { buttom_znak.Visibility = ViewStates.Gone; txt2.Visibility = ViewStates.Gone; txt2.Text = ""; } }
private void RadCarTypeAiLiShe_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (radCarTypeAiLiShe.Checked) { edtTxtGearOneLowEngineRpm.Text = lstEngineRatioSource[Convert.ToInt16(CarType.AiLiShe)][0].ToString(); edtTxtGearOneHighEngineRpm.Text = lstEngineRatioSource[Convert.ToInt16(CarType.AiLiShe)][1].ToString();; edtTxtGearTwoLowEngineRpm.Text = lstEngineRatioSource[Convert.ToInt16(CarType.AiLiShe)][2].ToString();; edtTxtGearTwoHighEngineRpm.Text = lstEngineRatioSource[Convert.ToInt16(CarType.AiLiShe)][3].ToString();; edtTxtGearThreeLowEngineRpm.Text = lstEngineRatioSource[Convert.ToInt16(CarType.AiLiShe)][4].ToString();; edtTxtGearThreeHighEngineRpm.Text = lstEngineRatioSource[Convert.ToInt16(CarType.AiLiShe)][5].ToString();; edtTxtGearFourLowEngineRpm.Text = lstEngineRatioSource[Convert.ToInt16(CarType.AiLiShe)][6].ToString();; edtTxtGearFourHighEngineRpm.Text = lstEngineRatioSource[Convert.ToInt16(CarType.AiLiShe)][7].ToString();; edtTxtGearFiveLowEngineRpm.Text = lstEngineRatioSource[Convert.ToInt16(CarType.AiLiShe)][8].ToString();; edtTxtGearFiveHighEngineRpm.Text = lstEngineRatioSource[Convert.ToInt16(CarType.AiLiShe)][9].ToString();; } }
private void ShowGridSwitch_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { diagram.PageSettings.ShowGrid = e.IsChecked; snapToGridSwitch.Enabled = e.IsChecked; if (!e.IsChecked) { for (int i = 0; i < scrollLayout.ChildCount; i++) { ColorCircle circle = scrollLayout.GetChildAt(i) as ColorCircle; if (circle.Selected) { circle.Selected = false; circle.SetWillNotDraw(true); circle.SetWillNotDraw(false); } } diagram.PageSettings.SnapToGrid = false; snapToGridSwitch.Checked = false; } }
private void OnCheckedChanged(object sender, CompoundButton.CheckedChangeEventArgs e) { InstanceID id = InstanceID.GetInstance(Context); if (e.IsChecked) { Intent intent = new Intent(Activity, typeof(RegistrationIntentService)); Context.StartService(intent); } else { try { id.DeleteInstanceID(); }catch (Exception exp) { Console.Write(exp.Message); } } }
private void ErrordialogButton_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (_updatingSettings) { return; } if (_showErrorDialog == null) { _showErrorDialog = new Setting(); } _showErrorDialog.SettingKey = "ShowErrorDialog"; _showErrorDialog.SettingValue = (_errordialogButton.Checked ? "True" : "False"); if (!_showErrorDialog.IsNew) { _showErrorDialog.IsDirty = true; } _madeChanges = true; }
private void EmergencyAudioButton_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (_updatingSettings) { return; } if (_confirmationAudio == null) { _confirmationAudio = new Setting(); } _confirmationAudio.SettingKey = "ConfirmationAudio"; _confirmationAudio.SettingValue = (_emergencyAudioButton.Checked ? "True" : "False"); if (!_confirmationAudio.IsNew) { _confirmationAudio.IsDirty = true; } _madeChanges = true; }
private void EmergencyButton_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (_updatingSettings) { return; } if (_showEmergency == null) { _showEmergency = new Setting(); } _showEmergency.SettingKey = "ShowHelpNow"; _showEmergency.SettingValue = (_emergencyButton.Checked ? "True" : "False"); if (!_showEmergency.IsNew) { _showEmergency.IsDirty = true; } _madeChanges = true; }
private async void OrderPlanned_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { CheckBox senderCheckBox = ((CheckBox)sender); var entityId = senderCheckBox.Tag.ToString(); SampleRepository repo = new SampleRepository(); var result = ""; if (_status == "Delivered") { result = await repo.MakeDelivered(entityId, ProcessID); } else { result = await repo.MakeReceived(entityId, ProcessID); } if (result == "1") { _context.RefreshGrid(); } }
private void NagContactsSwitch_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (_updatingSettings) { return; } if (_nagContacts == null) { _nagContacts = new Setting(); } _nagContacts.SettingKey = "NagContacts"; _nagContacts.SettingValue = (_nagContactsSwitch.Checked ? "True" : "False"); if (!_nagContacts.IsNew) { _nagContacts.IsDirty = true; } _madeChanges = true; }
void S_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { var sw = sender as Switch; var row = int.Parse(sw.Tag.ToString()); switch (row) { case 6: settings.NotifyEnabled = sw.Checked; break; case 7: settings.Notify90Enabled = sw.Checked; break; case 8: settings.Notify100Enabled = sw.Checked; break; case 13: settings.Level1Raids = sw.Checked; break; case 14: settings.Level2Raids = sw.Checked; break; case 15: settings.Level3Raids = sw.Checked; break; case 16: settings.Level4Raids = sw.Checked; break; case 17: settings.LegondaryRaids = sw.Checked; break; } }
void ProxyCheckedChanged(object sender, CompoundButton.CheckedChangeEventArgs e) { if (e.IsChecked) { proxyUsername.Enabled = true; proxyPassword.Enabled = true; proxyServer.Enabled = true; proxyPort.Enabled = true; } else { proxyUsername.Enabled = false; proxyUsername.Text = ""; proxyPassword.Enabled = false; proxyPassword.Text = ""; proxyServer.Enabled = false; proxyServer.Text = ""; proxyPort.Enabled = false; proxyPort.Text = ""; proxy = null; } }