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


C# Button.SetLocalizedContent方法代码示例

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


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

示例1: CreateCustomAuth

 private void CreateCustomAuth()
 {
     if (MeCore.Config.Server.Auths.Count != 0)
     {
         short i = 0;
         foreach (var item in MeCore.Config.Server.Auths)
         {
             ++i;
             Grid gridCustomAuth = new Grid();
             gridCustomAuth.Visibility = Visibility.Collapsed;
             Label lbltitie = new Label();
             lbltitie.SetLocalizedContent("Login");
             lbltitie.FontSize = 21.333;
             lbltitie.Margin = new Thickness(10, 10, 0, 0);
             lbltitie.HorizontalAlignment = HorizontalAlignment.Left;
             lbltitie.VerticalAlignment = VerticalAlignment.Top;
             gridCustomAuth.Children.Add(lbltitie);
             Label lblune = new Label();
             lblune.SetLocalizedContent("UNEM");
             lblune.FontSize = 16;
             lblune.Margin = new Thickness(10, 45, 0, 0);
             lblune.HorizontalAlignment = HorizontalAlignment.Left;
             lblune.VerticalAlignment = VerticalAlignment.Top;
             gridCustomAuth.Children.Add(lblune);
             TextBox txtboxune = new TextBox();
             txtboxune.Text = "";
             txtboxune.FontSize = 18.667;
             txtboxune.Margin = new Thickness(10, 75, 10, 0);
             txtboxune.Height = 30;
             txtboxune.HorizontalAlignment = HorizontalAlignment.Stretch;
             txtboxune.VerticalAlignment = VerticalAlignment.Top;
             txtboxune.TextWrapping = TextWrapping.Wrap;
             gridCustomAuth.Children.Add(txtboxune);
             Label lblpw = new Label();
             lblpw.SetLocalizedContent("PW");
             lblpw.FontSize = 16;
             lblpw.Margin = new Thickness(10, 105, 0, 0);
             lblpw.HorizontalAlignment = HorizontalAlignment.Left;
             lblpw.VerticalAlignment = VerticalAlignment.Top;
             gridCustomAuth.Children.Add(lblpw);
             PasswordBox pwbox = new PasswordBox();
             pwbox.Password = "";
             pwbox.FontSize = 18.667;
             pwbox.Margin = new Thickness(10, 135, 10, 0);
             pwbox.Height = 30;
             pwbox.HorizontalAlignment = HorizontalAlignment.Stretch;
             pwbox.VerticalAlignment = VerticalAlignment.Top;
             gridCustomAuth.Children.Add(pwbox);
             Button butback = new Button();
             butback.SetLocalizedContent("Back");
             butback.FontSize = 16;
             butback.Margin = new Thickness(0, 0, 10, 10);
             butback.Width = 202; butback.Height = 32;
             butback.HorizontalAlignment = HorizontalAlignment.Right;
             butback.VerticalAlignment = VerticalAlignment.Bottom;
             butback.BorderThickness = new Thickness(2);
             butback.Style = (Style)Resources["NormalButton"];
             butback.Click += delegate (object sender, RoutedEventArgs e) {
                 gridCustomAuth.Visibility = Visibility.Collapsed;
                 gridMenu.Visibility = Visibility.Visible;
             };
             gridCustomAuth.Children.Add(butback);
             Button butlogin = new Button();
             butlogin.SetLocalizedContent("Login");
             butlogin.FontSize = 16;
             butlogin.Margin = new Thickness(0, 0, 217, 10);
             butlogin.Width = 202; butlogin.Height = 32;
             butlogin.HorizontalAlignment = HorizontalAlignment.Right;
             butlogin.VerticalAlignment = VerticalAlignment.Bottom;
             butlogin.BorderThickness = new Thickness(2);
             butlogin.Style = (Style)Resources["NormalButton"];
             butlogin.Click += delegate (object sender, RoutedEventArgs e) {
                 auth = new Launch.Login.YggdrasilLoginAuth(txtboxune.Text, pwbox.Password,new Launch.Login.YggdrasilHelper(item.Url));
                 if (requiredPreLogin)
                 {
                     info = auth.Login();
                     auth = !string.IsNullOrWhiteSpace(info.ErrorMsg) ? null : new Launch.Login.YggdrasilRefreshAuth(info.Session, new Launch.Login.YggdrasilHelper(item.Url));
                 }
                 Close();
             };
             gridCustomAuth.Children.Add(butlogin);
             gridMain.Children.Add(gridCustomAuth);
             ButtonMenu butcustomauth = new ButtonMenu();
             butcustomauth.Content = string.Format(Lang.LangManager.GetLangFromResource("Online"), item.Name);
             butcustomauth.MenuImage = new BitmapImage(new Uri("pack://application:,,,/Resources/others.png"));
             butcustomauth.FontSize = 16;
             butcustomauth.Margin = new Thickness(0, 60 * (i + 1), -17, 0);
             butcustomauth.Height = 60;
             butcustomauth.Background = new SolidColorBrush(Colors.White);
             butcustomauth.VerticalAlignment = VerticalAlignment.Top;
             butcustomauth.Style = (Style)Resources["ButtonMeListSolid"];
             butcustomauth.ListType = true;
             butcustomauth.Click += delegate (object sender, RoutedEventArgs e) {
                 gridMenu.Visibility = Visibility.Collapsed;
                 gridCustomAuth.Visibility = Visibility.Visible;
             };
             gridscrolllist.Children.Add(butcustomauth);
         }
     }
 }
开发者ID:cvronmin,项目名称:metocraft,代码行数:100,代码来源:ACLogin.xaml.cs


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