public static string ConstructQualifiedName(ILogonCredentials credentials) { if (IsCustomProfile(credentials.ProfileName)) { return(credentials.ProfileName); } return($"{credentials.ProfileName} ({credentials.ProfileScope})"); }
public bool DirectlyReferences(ILogonCredentials credentials) { if (base.InheritSettingsType.Mode == InheritanceMode.None && ProfileName.Scope == credentials.ProfileScope) { return(ProfileName.Value == credentials.ProfileName); } return(false); }
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); }
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; }
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); } }
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; } } }