コード例 #1
0
 public static string ConstructQualifiedName(ILogonCredentials credentials)
 {
     if (IsCustomProfile(credentials.ProfileName))
     {
         return(credentials.ProfileName);
     }
     return($"{credentials.ProfileName} ({credentials.ProfileScope})");
 }
コード例 #2
0
 public bool DirectlyReferences(ILogonCredentials credentials)
 {
     if (base.InheritSettingsType.Mode == InheritanceMode.None && ProfileName.Scope == credentials.ProfileScope)
     {
         return(ProfileName.Value == credentials.ProfileName);
     }
     return(false);
 }
コード例 #3
0
        public CredentialsProfile LookupCredentialsProfile(ILogonCredentials logonCredentials)
        {
            CredentialsStore credentialsProfiles = Program.CredentialsProfiles;

            if (logonCredentials.ProfileScope == ProfileScope.File)
            {
                credentialsProfiles = FileGroup.CredentialsProfiles;
            }
            credentialsProfiles.TryGetValue(logonCredentials.ProfileName, out CredentialsProfile profile);
            return(profile);
        }
コード例 #4
0
ファイル: CredentialsUI.cs プロジェクト: xxftapv/RDCMan
 public void InitFromCredentials(ILogonCredentials credentials)
 {
     if (ProfileComboBox != null)
     {
         _usingCustomCredentials       = LogonCredentials.IsCustomProfile(credentials.ProfileName);
         ProfileComboBox.SelectedIndex = ProfileComboBox.FindItem(LogonCredentials.ConstructQualifiedName(credentials));
     }
     UserNameTextBox.Text = credentials.UserName;
     InitPassword(credentials.Password);
     DomainTextBox.Text = credentials.Domain;
 }
コード例 #5
0
ファイル: CredentialsStore.cs プロジェクト: xxftapv/RDCMan
 public void ReadXml(XmlNode xmlNode, ProfileScope scope, RdcTreeNode node, ICollection <string> errors)
 {
     foreach (XmlNode childNode in xmlNode.ChildNodes)
     {
         LogonCredentials logonCredentials = new LogonCredentials("", "credentialsProfile");
         logonCredentials.ReadXml(childNode, node, errors);
         ILogonCredentials  logonCredentials2  = logonCredentials;
         CredentialsProfile credentialsProfile = new CredentialsProfile(logonCredentials2.ProfileName, scope, logonCredentials2.UserName, logonCredentials2.Password, logonCredentials2.Domain);
         this[logonCredentials2.ProfileName] = credentialsProfile;
         Encryption.DeferDecryption(credentialsProfile, node, credentialsProfile.QualifiedName);
     }
 }
コード例 #6
0
ファイル: CredentialsUI.cs プロジェクト: xxftapv/RDCMan
 private void OnProfileChanged(object sender, EventArgs e)
 {
     if (_inheritSettings == null || !_inheritSettings.FromParentCheck.Checked)
     {
         ILogonCredentials selectedValue = ProfileComboBox.SelectedValue;
         _usingCustomCredentials = LogonCredentials.IsCustomProfile(selectedValue.ProfileName);
         EnableDisableControls(enable: true);
         if (_usingCustomCredentials)
         {
             UserNameTextBox.Text = Environment.UserName;
             InitPassword(null);
             DomainTextBox.Text = Environment.UserDomainName;
         }
         else
         {
             UserNameTextBox.Text = selectedValue.UserName;
             InitPassword(selectedValue.Password);
             DomainTextBox.Text = selectedValue.Domain;
         }
     }
 }