当前位置: 首页>>代码示例>>C#>>正文


C# CheckBox.HasUserInteracted方法代码示例

本文整理汇总了C#中System.Windows.Controls.CheckBox.HasUserInteracted方法的典型用法代码示例。如果您正苦于以下问题:C# CheckBox.HasUserInteracted方法的具体用法?C# CheckBox.HasUserInteracted怎么用?C# CheckBox.HasUserInteracted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.CheckBox的用法示例。


在下文中一共展示了CheckBox.HasUserInteracted方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetStringValue

 /// <summary>
 /// Sets the value of <paramref name="keyName"/> in <paramref name="registryKey"/> to '1' (REG_SZ) if
 /// <paramref name="chk"/>'s IsChecked is equal to true, otherwise sets it to '0' (REG_SZ).
 /// This behaviour is reversed if <paramref name="inverse"/> is set to true.
 /// Each <paramref name="chk" /> has a tag associated with it, which when set to 1 (HasUserInteracted)
 /// will then be saved to registry, otherwise it'll be ignored.
 /// </summary>
 /// <param name="registryKey"></param>
 /// <param name="chk"></param>
 /// <param name="keyName"></param>
 /// <param name="inverse"></param>
 public static void SetStringValue(this RegistryKey registryKey, CheckBox chk, string keyName,
     bool inverse = false)
 {
     if (chk.HasUserInteracted()) {
         string val = inverse ? Utils.ReversedBoolToString(chk.IsChecked) : Utils.BoolToString(chk.IsChecked);
         registryKey.SetValue(keyName, val);
     }
 }
开发者ID:pankajbhandari08,项目名称:windows-tweaker,代码行数:19,代码来源:UIRegistryHandler.cs

示例2: SetValue

 /// <summary>
 /// Sets the value of <paramref name="keyName"/> in <paramref name="registryKey"/> to 1 (REG_DWORD) if
 /// <paramref name="chk"/>'s IsChecked is equal to true, otherwise sets it to 0 (REG_DWORD).
 /// This behaviour is reversed if <paramref name="inverse"/> is set to true.
 /// Each <paramref name="chk" /> has a tag associated with it, which when set to 1 (HasUserInteracted)
 /// will then be saved to registry, otherwise it'll be ignored.
 /// </summary>
 /// <param name="registryKey"></param>
 /// <param name="chk"></param>
 /// <param name="keyName"></param>
 /// <param name="inverse"></param>
 internal static void SetValue(this RegistryKey registryKey, CheckBox chk, string keyName, bool inverse = false)
 {
     if (chk.HasUserInteracted()) {
         registryKey.SetValue(keyName, chk.IsChecked, inverse);
     }
 }
开发者ID:pankajbhandari08,项目名称:windows-tweaker,代码行数:17,代码来源:UIRegistryHandler.cs

示例3: SetSubKey

 /// <summary>
 /// Creates a sub-key with name (if it doesn't exists) <paramref name="keyName"/> under <paramref name="registryKey"/> if
 /// <paramref name="chk"/>'s IsChecked is equal to true, otherwise it deletes it (if present).
 /// Each <paramref name="chk" /> has a tag associated with it, which when set to 1 (HasUserInteracted)
 /// will then be saved to registry, otherwise it'll be ignored.
 /// </summary>
 /// <param name="registryKey"></param>
 /// <param name="chk"></param>
 /// <param name="keyName"></param>
 internal static void SetSubKey(this RegistryKey registryKey, CheckBox chk, string keyName)
 {
     if (chk.HasUserInteracted()) {
         registryKey.SetSubKey(keyName, chk.IsChecked);
     }
 }
开发者ID:pankajbhandari08,项目名称:windows-tweaker,代码行数:15,代码来源:UIRegistryHandler.cs


注:本文中的System.Windows.Controls.CheckBox.HasUserInteracted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。