本文整理匯總了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;
}
}
};
//.........這裏部分代碼省略.........