示例#1
0
        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();
        }
示例#2
0
 public CredentialsProfile(string profileName, ProfileScope profileScope, string userName, PasswordSetting password, string domain)
 {
     _profileName  = profileName;
     _profileScope = profileScope;
     _userName     = userName;
     _password     = password;
     _domain       = domain;
 }
示例#3
0
 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();
 }
示例#4
0
 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;
 }
示例#5
0
 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
 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;
     }
 }
示例#7
0
 public void Reset()
 {
     Scope      = ProfileScope.Local;
     base.Value = "Custom";
 }
示例#8
0
 public void UpdateValue(string newValue, ProfileScope newScope)
 {
     base.Value = newValue;
     Scope      = newScope;
 }
示例#9
0
 public override void Copy(ISetting source)
 {
     base.Copy(source);
     Scope = ((ProfileSetting)source).Scope;
 }
示例#10
0
        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);
            }
        }
示例#11
0
 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
 }
示例#12
0
 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
 }
示例#13
0
 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
 }