Ejemplo n.º 1
0
        private SVNUser GetUserData(string currentLine)
        {
            var retval = new SVNUser();

            string[] data = currentLine.Split('=');

            retval.UserName             = data[0].Trim();
            retval.Password             = data[1].Trim();
            retval.ParentRepositoryPath = _repositoryConfiguration.RepositoryRootDirectory;
            retval.UserDatabasePath     = _repositoryConfiguration.UserDatabaseFileName;

            return(retval);
        }
Ejemplo n.º 2
0
        private void GetUsers(string repositoryPath)
        {
            var repo = new FileInfo(repositoryPath);

            if (_repositoryConfiguration.UserDatabaseFileName.Length > 0)
            {
                string root = repo.DirectoryName;

                Common.GetCorrectedPath(root, false);

                string userDbFullPath = _repositoryConfiguration.UserDatabaseFileName;

                if (userDbFullPath != string.Empty)
                {
                    _users = new SVNUserCollection();
                    StreamReader userRead = File.OpenText(userDbFullPath);

                    while (userRead.Peek() != -1)
                    {
                        string currLine = userRead.ReadLine();

                        switch (currLine.ToUpper().Trim())
                        {
                        case "[USERS]":
                        case "":
                            break;

                        default:
                            string start = currLine.Substring(0, 1);

                            // Ignore comment lines
                            switch (start)
                            {
                            case "#":
                            case ";":
                                break;

                            default:
                                SVNUser newUser = this.GetUserData(currLine);
                                _users.Add(newUser);
                                break;
                            }
                            break;
                        }
                    }

                    userRead.Close();
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Determines whether [contains] [the specified item].
 /// </summary>
 /// <param name="Item">The item.</param>
 /// <returns>
 ///     <c>true</c> if [contains] [the specified item]; otherwise, <c>false</c>.
 /// </returns>
 public bool Contains(SVNUser Item)
 {
     return(List.Contains(Item));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Removes the specified item.
 /// </summary>
 /// <param name="Item">The item.</param>
 public void Remove(SVNUser Item)
 {
     List.Remove(Item);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Inserts the specified index.
 /// </summary>
 /// <param name="Index">The index.</param>
 /// <param name="Item">The item.</param>
 public void Insert(int Index, SVNUser Item)
 {
     List.Insert(Index, Item);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Adds the specified item.
 /// </summary>
 /// <param name="Item">The item.</param>
 /// <returns></returns>
 public int Add(SVNUser Item)
 {
     return(List.Add(Item));
 }