Example #1
0
        public HttpSession(string baseUrl, Authentication authentication)
        {
            LOG.Debug("Create HttpSession with baseUrl: " + baseUrl);
            if (authentication != null)
            {
                LOG.Debug("Using authentication: " + authentication.Name);
            }

            this.SetBaseUrl(baseUrl);
            this.SetAuthentication(authentication);
        }
Example #2
0
 public void AddAuthentication(Authentication authentication)
 {
     this.authentications.Add(authentication);
 }
Example #3
0
 public void SetAuthentication(Authentication authentication)
 {
     this.authentication = authentication;
 }
Example #4
0
        private void ReadAuthentications(Project project)
        {
            Authentication authentication = null;

            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                    case XmlNodeType.Element:

                        if (reader.Name.Equals("authentication"))
                        {
                            authentication = new Authentication();

                            for (int i = 0; i < reader.AttributeCount; i++)
                            {
                                reader.MoveToAttribute(i);
                                if (reader.Name.Equals("type"))
                                {
                                    authentication.Type = reader.Value;
                                }
                            }
                        }
                        else if (reader.Name.Equals("name"))
                        {
                            authentication.Name = reader.ReadElementContentAsString();
                        }
                        else if (reader.Name.Equals("user"))
                        {
                            authentication.User = reader.ReadElementContentAsString();
                        }
                        else if (reader.Name.Equals("password"))
                        {
                            authentication.Password = reader.ReadElementContentAsString();
                        }

                        break;

                    case XmlNodeType.EndElement:

                        if (reader.Name.Equals("authentication"))
                        {
                            project.AddAuthentication(authentication);
                            return;
                        }
                        else if (reader.Name.Equals("authentications"))
                        {
                            return;
                        }

                        break;
                }
            }
        }