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


C# RadioButton.GetUpperBound方法代码示例

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


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

示例1: queueDownloader_OpenReadCompleted

 void queueDownloader_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
 {
     QueueParallelDownloader queueDownloader = sender as QueueParallelDownloader;
     queueDownloader.DownloadCompleted -= queueDownloader_OpenReadCompleted;
     Canvas body = new Canvas() {
         Width = 255,
         Height = 200,
         Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/105.png", UriType.Web) }
     };
     RadioButton[] languages = new RadioButton[5];
     languages[0] = new RadioButton() {
         Tag = "zh-cn",
         Content = new TextBlock() {
             Text = "简体中文",
             Style = Application.Current.Resources["TextStyle0"] as Style,
             TextWrapping = TextWrapping.Wrap,
             Foreground = new SolidColorBrush(Color.FromArgb(255, 239, 255, 208)),
         },
         FontSize = 14,
         GroupName = "Language",
         IsChecked = true,
     };
     languages[1] = new RadioButton() {
         Tag = "zh-tw",
         Content = new TextBlock() {
             Text = "繁體中文",
             Style = Application.Current.Resources["TextStyle0"] as Style,
             TextWrapping = TextWrapping.Wrap,
             Foreground = new SolidColorBrush(Color.FromArgb(255, 239, 255, 208)),
         },
         FontSize = 14,
         GroupName = "Language",
     };
     languages[2] = new RadioButton() {
         Tag = "us",
         Content = new TextBlock() {
             Text = "English",
             Style = Application.Current.Resources["TextStyle0"] as Style,
             TextWrapping = TextWrapping.Wrap,
             Foreground = new SolidColorBrush(Color.FromArgb(255, 239, 255, 208)),
         },
         FontSize = 14,
         GroupName = "Language"
     };
     languages[3] = new RadioButton() {
         Tag = "jp",
         Content = new TextBlock() {
             Text = "日本語",
             Style = Application.Current.Resources["TextStyle0"] as Style,
             TextWrapping = TextWrapping.Wrap,
             Foreground = new SolidColorBrush(Color.FromArgb(255, 239, 255, 208)),
         },
         FontSize = 14,
         GroupName = "Language"
     };
     languages[4] = new RadioButton() {
         Tag = "kr",
         Content = new TextBlock() {
             Text = "한국의",
             Style = Application.Current.Resources["TextStyle0"] as Style,
             TextWrapping = TextWrapping.Wrap,
             Foreground = new SolidColorBrush(Color.FromArgb(255, 239, 255, 208)),
         },
         FontSize = 14,
         GroupName = "Language"
     };
     for (int i = 0; i <= languages.GetUpperBound(0); i++) {
         body.Children.Add(languages[i]);
         Canvas.SetLeft(languages[i], 86); Canvas.SetTop(languages[i], -5 + i * 35);
     }
     ImageButton closer = new ImageButton() {
         TotalWidth = 93,
         TotalHeight = 27,
         Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/106.png", UriType.Web), Stretch = Stretch.None },
         Text = "提交(OK)",
         TextStyle = Application.Current.Resources["TextStyle1"] as Style,
         TextSize = 14,
         TextHasEffect = true,
         TextEffectColor = Colors.Black,
         TextBrush = new SolidColorBrush(Colors.LightGray),
         TextHoverBrush = new SolidColorBrush(Colors.White),
     };
     body.Children.Add(closer); Canvas.SetLeft(closer, 73); Canvas.SetTop(closer, 167);
     MouseButtonEventHandler handler0 = null;
     closer.Click += handler0 = delegate {
         closer.Click -= handler0;
         for (int i = 0; i <= languages.GetUpperBound(0); i++) {
             if (languages[i].IsChecked.Value) {
                 ParallelDownloader downloader = new ParallelDownloader();
                 OpenReadCompletedEventHandler handler = null;
                 downloader.OpenReadCompleted += handler = (s2, e2) => {
                     downloader.OpenReadCompleted -= handler;
                     Infos["Language"] = XElement.Load(e2.Result as Stream);
                     if (Submit != null) { Submit(this, null); }
                 };
                 downloader.OpenReadAsync(string.Format(GlobalMethod.WebPath("Language/{0}.xml"), languages[i].Tag.ToString()), DownloadPriority.Highest, null, false, 0);
                 break;
             }
         }
     };
//.........这里部分代码省略.........
开发者ID:Gallardot,项目名称:GallardotStorage,代码行数:101,代码来源:LanguageChoicer.cs


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