本文整理汇总了C#中CompoundButton类的典型用法代码示例。如果您正苦于以下问题:C# CompoundButton类的具体用法?C# CompoundButton怎么用?C# CompoundButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CompoundButton类属于命名空间,在下文中一共展示了CompoundButton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnCheckedChanged
private void OnCheckedChanged(object sender, CompoundButton.CheckedChangeEventArgs e)
{
var preferences = PreferenceManager.GetDefaultSharedPreferences(SkillStoreApplication.AppContext);
var prefEditor = preferences.Edit();
prefEditor.PutBoolean(SettingsKey.ShowAgainPreference, e.IsChecked);
prefEditor.Commit();
}
开发者ID:mdanz92,项目名称:teco.SkillStore,代码行数:7,代码来源:AnalyzerTabFragment.cs
示例2: OnCheckedChange
void CompoundButton.IOnCheckedChangeListener.OnCheckedChanged(CompoundButton buttonView, bool isChecked)
{
if (OnCheckedChange != null)
{
OnCheckedChange(buttonView, isChecked);
}
}
开发者ID:jlarsson,项目名称:Gas,代码行数:7,代码来源:OnCheckedChangeListenerForCompoundButton.cs
示例3: OnCheckedChanged
public void OnCheckedChanged(IDrawerItem drawerItem, CompoundButton buttonView, bool isChecked)
{
if (drawerItem is INameable) {
Log.Info("material-drawer", "DrawerItem: " + ((INameable) drawerItem).Name + " - toggleChecked: " + isChecked);
} else {
Log.Info("material-drawer", "toggleChecked: " + isChecked);
}
}
开发者ID:jwnace,项目名称:MaterialDrawer-Xamarin,代码行数:8,代码来源:MainActivity.cs
示例4: OnRadioButtonCheckedChange
private void OnRadioButtonCheckedChange(object sender, CompoundButton.CheckedChangeEventArgs args)
{
var radionButton = (sender as RadioButton);
if (radionButton != null)
{
this.Check(radionButton.Id);
}
}
开发者ID:Everbridge,项目名称:sm-MvvmCross,代码行数:8,代码来源:MvxRadioGroup.cs
示例5: checkBox_CheckedChange
void checkBox_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e)
{
Agreed = e.IsChecked;
if (e.IsChecked)
NotifyCompleted();
else
NotifyIncomplete();
}
开发者ID:pacificIT,项目名称:WizarDroid.Net,代码行数:9,代码来源:FormStep2.cs
示例6: OnSortingForSupplierIDChanged
void OnSortingForSupplierIDChanged (object sender, CompoundButton.CheckedChangeEventArgs e)
{
var supplierId = sfGrid.Columns.FirstOrDefault (x => x.MappingName == "SupplierID");
if (e.IsChecked)
supplierId.AllowSorting = true;
else
supplierId.AllowSorting = false;
}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:9,代码来源:Sorting.cs
示例7: OnCheckedChanged
public void OnCheckedChanged(CompoundButton buttonView, bool isChecked)
{
if (buttonView.Id == Resource.Id.lockDrawerButton) {
this.drawer.IsLocked = isChecked;
}
if (buttonView.Id == Resource.Id.drawerTapOutsideButton) {
this.drawer.TapOutsideToClose = isChecked;
}
}
开发者ID:bmccool,项目名称:Android-samples,代码行数:10,代码来源:DrawerInitialSetupFragment.cs
示例8: AlarmEnabledChange
void AlarmEnabledChange (object sender, CompoundButton.CheckedChangeEventArgs e)
{
if (_selectedAlarm == null || _selectedAlarm.Enabled == e.IsChecked)
return;
EnableAlarm (_selectedAlarm, e.IsChecked);
Mode = Mode.MarkerSelected;
if (!e.IsChecked) {
StopRinging ();
}
GoogleAnalyticsManager.ReportEvent (GACategory.MainScreen, GAAction.Click, "alarm " + (e.IsChecked ? "enabled" : "disabled"));
}
开发者ID:foxanna,项目名称:SimpleLocationAlarm,代码行数:13,代码来源:HomeActivityAddMode.cs
示例9: tgConnect_HandleCheckedChange
void tgConnect_HandleCheckedChange (object sender, CompoundButton.CheckedChangeEventArgs e)
{
if (e.IsChecked) {
Connect();
} else {
if (btSocket.IsConnected) {
try {
btSocket.Close();
} catch (System.Exception ex) {
Console.WriteLine (ex.Message);
}
}
}
}
开发者ID:EnriqueProinfo,项目名称:Mono,代码行数:14,代码来源:MainActivity.cs
示例10: Screen4Lobby_CheckedChange
private void Screen4Lobby_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e)
{
var liftCheckBox = (CheckBox) sender;
View.FindViewById<CheckBox>(Resource.Id.liftBrail).Enabled = liftCheckBox.Checked;
View.FindViewById<CheckBox>(Resource.Id.liftDepth).Enabled = liftCheckBox.Checked;
View.FindViewById<CheckBox>(Resource.Id.liftDoorWeight).Enabled = liftCheckBox.Checked;
View.FindViewById<CheckBox>(Resource.Id.liftWight).Enabled = liftCheckBox.Checked;
if (!liftCheckBox.Checked)
{
View.FindViewById<CheckBox>(Resource.Id.liftBrail).Checked = liftCheckBox.Checked;
View.FindViewById<CheckBox>(Resource.Id.liftDepth).Checked = liftCheckBox.Checked;
View.FindViewById<CheckBox>(Resource.Id.liftDoorWeight).Checked = liftCheckBox.Checked;
View.FindViewById<CheckBox>(Resource.Id.liftWight).Checked = liftCheckBox.Checked;
}
}
开发者ID:Teplitsa,项目名称:bezpregrad,代码行数:15,代码来源:Screen4Lobby.cs
示例11:
void CompoundButton.IOnCheckedChangeListener.OnCheckedChanged (CompoundButton buttonView, bool isChecked)
{
if (isChecked) {
btnOne.Enabled=false;
btnZero.Enabled=false;
Animate (holoCircularProgressBar,this);
}
else {
_animationHasEnded = true;
_progressBarAnimator.Cancel();
btnOne.Enabled=true;
btnZero.Enabled=true;
}
}
开发者ID:jeedey93,项目名称:xamarin-android-samples,代码行数:16,代码来源:MainActivity.cs
示例12: OnCreate
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.camera_demo);
animateToggle = FindViewById<CompoundButton> (Resource.Id.animate);
customDurationToggle = FindViewById<CompoundButton> (Resource.Id.duration_toggle);
customDurationBar = FindViewById<SeekBar> (Resource.Id.duration_bar);
updateEnabledState ();
var mapFragment =
(SupportMapFragment) SupportFragmentManager.FindFragmentById (Resource.Id.map);
mapFragment.GetMapAsync (this);
}
开发者ID:ravensorb,项目名称:AdMobBuddy,代码行数:16,代码来源:CameraDemoActivity.cs
示例13: OnUseBillingAddress
void OnUseBillingAddress(object sender, CompoundButton.CheckedChangeEventArgs e)
{
AddrLine1.Text = e.IsChecked ? Cust.BillingAddress.Line1 : "";
AddrLine2.Text = e.IsChecked ? Cust.BillingAddress.Line2 : "";
AddrCity.Text = e.IsChecked ? Cust.BillingAddress.City: "";
AddrState.Text = e.IsChecked ? Cust.BillingAddress.State: "";
AddrZipCode.Text = e.IsChecked ? Cust.BillingAddress.ZipCode: "";
AddrLine1.Enabled = !e.IsChecked;
AddrLine2.Enabled = !e.IsChecked;
AddrCity.Enabled = !e.IsChecked;
AddrState.Enabled = !e.IsChecked;
AddrZipCode.Enabled = !e.IsChecked;
if (e.IsChecked)
NotifyCompleted();
else
NotifyIncomplete();
}
开发者ID:cryptocoinx,项目名称:WizarDroid.Net,代码行数:19,代码来源:CustomerWizardStep3.cs
示例14: OnCreateView
public override Android.Views.View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle p2)
{
mRootView = (ViewGroup)inflater.Inflate (Resource.Layout.fragment_vendor_detail, null);
mName = mRootView.FindViewById<TextView> (Resource.Id.vendor_name);
mStarred = mRootView.FindViewById<CompoundButton> (Resource.Id.star_button);
mStarred.Focusable = true;
mStarred.Clickable = true;
// Larger target triggers star toggle
View starParent = mRootView.FindViewById (Resource.Id.header_vendor);
FractionalTouchDelegate.SetupDelegate (starParent, mStarred, new RectF (0.6f, 0f, 1f, 0.8f));
mLogo = mRootView.FindViewById<ImageView> (Resource.Id.vendor_logo);
mUrl = mRootView.FindViewById<TextView> (Resource.Id.vendor_url);
mDesc = mRootView.FindViewById<TextView> (Resource.Id.vendor_desc);
mProductDesc = mRootView.FindViewById<TextView> (Resource.Id.vendor_product_desc);
return mRootView;
}
开发者ID:BratislavDimitrov,项目名称:monodroid-samples,代码行数:22,代码来源:VendorDetailFragment.cs
示例15: tgConnect_HandleCheckedChange
void tgConnect_HandleCheckedChange (object sender, CompoundButton.CheckedChangeEventArgs e)
{
if (e.IsChecked) {
driver = UsbSerialProber.Acquire(manager);
if (driver != null) {
driver.Open ();
driver.SetBaudRate (9600);
beginListenForData ();
dataToSend = new Java.Lang.String("e");
writeData(dataToSend);
}
else
{
Toast.MakeText (this, "Error Arduino no detectado", ToastLength.Short).Show();
}
} else {
try {
driver.Close();
} catch (System.Exception ex) {
Console.WriteLine (ex.Message);
}
}
}
开发者ID:EnriqueProinfo,项目名称:Mono,代码行数:23,代码来源:MainActivity.cs
示例16: OnCustomThemeCheckChanged
private void OnCustomThemeCheckChanged(object sender, CompoundButton.CheckedChangeEventArgs e)
{
mThemeView.Visibility = e.IsChecked ? ViewStates.Visible : ViewStates.Gone;
}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:4,代码来源:TilesFragment.cs
示例17: OnToggleSensorSection
private async void OnToggleSensorSection(object sender, CompoundButton.CheckedChangeEventArgs e)
{
if (!Model.Instance.Connected)
{
return;
}
EnsureSensorsCreated();
Switch sw = (Switch)sender;
TableLayout table = mSensorMap[sw];
if (e.IsChecked)
{
table.Visibility = ViewStates.Visible;
if (table == mTableAccelerometer)
{
mRadioGroupAccelerometer.Enabled = false;
SetChildrenEnabled(mRadioGroupAccelerometer, false);
}
else if (table == mTableGyro)
{
mRadioGroupGyro.Enabled = false;
SetChildrenEnabled(mRadioGroupGyro, false);
}
// Turn on the appropriate sensor
try
{
if (sw == mSwitchAccelerometer)
{
SampleRate rate;
if (mRadioAcc16.Checked)
{
rate = SampleRate.Ms16;
}
else if (mRadioAcc32.Checked)
{
rate = SampleRate.Ms32;
}
else
{
rate = SampleRate.Ms128;
}
mTextAccX.Text = "";
mTextAccY.Text = "";
mTextAccZ.Text = "";
accelerometerSensor.StartReadings(rate);
}
else if (sw == mSwitchGyro)
{
SampleRate rate;
if (mRadioGyro16.Checked)
{
rate = SampleRate.Ms16;
}
else if (mRadioGyro32.Checked)
{
rate = SampleRate.Ms32;
}
else
{
rate = SampleRate.Ms128;
}
mTextGyroAccX.Text = "";
mTextGyroAccY.Text = "";
mTextGyroAccZ.Text = "";
mTextGyroAngX.Text = "";
mTextGyroAngY.Text = "";
mTextGyroAngZ.Text = "";
gyroscopeSensor.StartReadings(rate);
}
else if (sw == mSwitchDistance)
{
mTextTotalDistance.Text = "";
mTextSpeed.Text = "";
mTextPace.Text = "";
mTextPedometerMode.Text = "";
distanceSensor.StartReadings();
}
else if (sw == mSwitchHeartRate)
{
var sensorMngr = Model.Instance.Client.SensorManager;
if (await sensorMngr.RequestHeartRateConsentTaskAsync(Activity))
{
mTextHeartRate.Text = "";
mTextHeartRateQuality.Text = "";
heartRateSensor.StartReadings();
}
else
{
Util.ShowExceptionAlert(Activity, "Start heart rate sensor", new Exception("User declined permission."));
}
}
else if (sw == mSwitchContact)
{
//.........这里部分代码省略.........
开发者ID:thomashandda,项目名称:Microsoft-Band-SDK-Bindings,代码行数:101,代码来源:SensorsFragment.cs
示例18: OnCheckedChanged
public void OnCheckedChanged(CompoundButton buttonView, bool isChecked)
{
OnUserValueChanged(isChecked);
}
开发者ID:indazoo,项目名称:MvvmCross_DesignData,代码行数:4,代码来源:CheckboxElement.cs
示例19: HandleCheckedChange
void HandleCheckedChange (object sender, CompoundButton.CheckedChangeEventArgs e)
{
var values = new ContentValues ();
values.Put (ScheduleContract.Sessions.SESSION_STARRED, e.IsChecked ? 1 : 0);
mHandler.StartUpdate (mSessionUri, values);
// Because change listener is set to null during initialization, these won't fire on
// pageview.
//AnalyticsUtils.getInstance(getActivity()).trackEvent("Sandbox", isChecked ? "Starred" : "Unstarred", mTitleString, 0);
}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:10,代码来源:SessionDetailFragment.cs
示例20: OnCreateView
public override Android.Views.View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle p2)
{
mRootView = (ViewGroup)inflater.Inflate (Resource.Layout.fragment_session_detail, null);
mTabHost = mRootView.FindViewById<TabHost> (Android.Resource.Id.TabHost);
mTabHost.Setup ();
mTitle = mRootView.FindViewById<TextView> (Resource.Id.session_title);
mSubtitle = mRootView.FindViewById<TextView> (Resource.Id.session_subtitle);
mStarred = mRootView.FindViewById<CompoundButton> (Resource.Id.star_button);
mStarred.CheckedChange += HandleCheckedChange;
mStarred.Focusable = true;
mStarred.Clickable = true;
// Larger target triggers star toggle
View starParent = mRootView.FindViewById<View> (Resource.Id.header_session);
FractionalTouchDelegate.SetupDelegate (starParent, mStarred, new RectF (0.6f, 0f, 1f, 0.8f));
mAbstract = mRootView.FindViewById<TextView> (Resource.Id.session_abstract);
mRequirements = mRootView.FindViewById<TextView> (Resource.Id.session_requirements);
SetupSummaryTab ();
SetupNotesTab ();
SetupLinksTab ();
return mRootView;
}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:29,代码来源:SessionDetailFragment.cs
注:本文中的CompoundButton类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论