private void SaveProfileButton_Click(object sender, EventArgs e) { string qualifiedUserName = GetQualifiedUserName(UserNameTextBox.Text, DomainTextBox.Text); using (SaveCredentialsDialog saveCredentialsDialog = new SaveCredentialsDialog(_file, qualifiedUserName)) { if (saveCredentialsDialog.ShowDialog() == DialogResult.OK) { ProfileScope profileScope = saveCredentialsDialog.ProfileScope; CredentialsStore credentialsProfiles = Program.CredentialsProfiles; if (profileScope == ProfileScope.File) { credentialsProfiles = _file.CredentialsProfiles; } qualifiedUserName = saveCredentialsDialog.ProfileName; bool flag = !credentialsProfiles.Contains(qualifiedUserName); CredentialsProfile credentialsProfile2 = credentialsProfiles[qualifiedUserName] = new CredentialsProfile(qualifiedUserName, profileScope, UserNameTextBox.Text, PasswordTextBox.Text, DomainTextBox.Text); string qualifiedName = credentialsProfile2.QualifiedName; if (flag) { ProfileComboBox.AddItem(qualifiedName, credentialsProfile2); } else { ProfileComboBox.ReplaceItem(qualifiedName, credentialsProfile2); } ProfileComboBox.SelectedValue = credentialsProfile2; } } ProfileComboBox.Focus(); }
public CredentialsProfile(string profileName, ProfileScope profileScope, string userName, PasswordSetting password, string domain) { _profileName = profileName; _profileScope = profileScope; _userName = userName; _password = password; _domain = domain; }
private void OnGatheringProfileScope(Dictionary <string, double> dict) { foreach (ProfileScopeData profileScopeData in ProfileScope.DataList) { dict[profileScopeData.Tag + ".Avg"] = profileScopeData.AvgDuration; dict[profileScopeData.Tag + ".Count"] = (double)profileScopeData.TotalCallCount; } ProfileScope.Clear(); }
public CredentialsProfile(string profileName, ProfileScope profileScope, string userName, string password, string domain) { _profileName = profileName; _profileScope = profileScope; _userName = userName; _password = new PasswordSetting(password) { IsDecrypted = true }; _domain = 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); } }
public override void ReadXml(XmlNode xmlNode, RdcTreeNode node) { base.ReadXml(xmlNode, node); try { XmlNode namedItem = xmlNode.Attributes.GetNamedItem("scope"); Scope = namedItem.InnerText.ParseEnum <ProfileScope>(); } catch { Scope = ProfileScope.Local; } }
public void Reset() { Scope = ProfileScope.Local; base.Value = "Custom"; }
public void UpdateValue(string newValue, ProfileScope newScope) { base.Value = newValue; Scope = newScope; }
public override void Copy(ISetting source) { base.Copy(source); Scope = ((ProfileSetting)source).Scope; }
private static AndroidJavaObject GetProfileScopeEnum(ProfileScope scope) { string name = ""; switch (scope) { case ProfileScope.Application: name = "APPLICATION"; break; case ProfileScope.Organization: name = "ORGANIZATION"; break; } using (var c = new AndroidJavaClass("com.localytics.android.Localytics$ProfileScope")) { return c.GetStatic<AndroidJavaObject>(name); } }
public static void SetProfileAttribute(string attributeName, string[] attributeValue, ProfileScope scope = ProfileScope.Application) { #if UNITY_ANDROID LocalyticsClass.CallStatic("setProfileAttribute", attributeName, attributeValue, GetProfileScopeEnum(scope)); #elif UNITY_IOS string values = MiniJSON.jsonEncode (attributeValue); _removeProfileAttributesFromSet (values, attributeName, (int)scope); #else throw new NotImplementedException("Localytics Unity SDK only supports iOS or Android"); #endif }
public static void IncrementProfileAttribute(string attributeName, long attributeValue, ProfileScope scope = ProfileScope.Application) { #if UNITY_ANDROID LocalyticsClass.CallStatic("incrementProfileAttribute", attributeName, attributeValue, GetProfileScopeEnum(scope)); #elif UNITY_IOS _incrementProfileAttribute (attributeName, attributeValue, (int)scope); #else throw new NotImplementedException("Localytics Unity SDK only supports iOS or Android"); #endif }
public static void AddProfileAttributesToSet(string attributeName, long[] attributeValue, ProfileScope scope = ProfileScope.Application) { #if UNITY_ANDROID LocalyticsClass.CallStatic("addProfileAttributesToSet", attributeName, attributeValue, GetProfileScopeEnum(scope)); #elif UNITY_IOS string values = ""; if (attributeValue != null) values = MiniJSON.jsonEncode (attributeValue); _addProfileAttributesToSet (attributeName, values, (int)scope); #else throw new NotImplementedException("Localytics Unity SDK only supports iOS or Android"); #endif }