コード例 #1
0
ファイル: Connect.xaml.cs プロジェクト: jwozny/CentralControl
        /// <summary>
        /// Enable the username and password boxes and populate them if the info is in the global config
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AD_LocalAuthCheckbox_Unchecked(object sender, RoutedEventArgs e)
        {
            AD_UsernameTextBox.IsEnabled = true;
            AD_PasswordBox.IsEnabled     = true;

            if (!string.IsNullOrEmpty(GlobalConfig.Settings.AD_Username) && !string.IsNullOrEmpty(GlobalConfig.Settings.AD_Password))
            {
                AD_UsernameTextBox.Text = GlobalConfig.Settings.AD_Username;
                AD_PasswordBox.Password = GlobalConfig.Settings.AD_Password;
            }
            else
            {
                AD_UsernameTextBox.Text = string.Empty;
                AD_PasswordBox.Password = string.Empty;
            }

            AD_UsernameTextBox.Focus();
        }
コード例 #2
0
ファイル: Connect.xaml.cs プロジェクト: jwozny/CentralControl
 /// <summary>
 /// Select all text in the username box when getting focus
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void AD_UsernameTextBox_GotFocus(object sender, RoutedEventArgs e)
 {
     AD_UsernameTextBox.SelectAll();
     AD_UsernameTextBox.Style = FindResource("TextBox") as Style;
 }
コード例 #3
0
 /// <summary>
 /// Select all text in the AD Username box when getting focus
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void AD_UsernameTextBox_GotFocus(object sender, RoutedEventArgs e)
 {
     AD_UsernameTextBox.SelectAll();
 }