public void AddNewRepository()
 {
     Repository rep = new Repository();
     rep.Name = "NewRepository";
     rep.Server = "localhost:8087";
     PlasticProgram.CreateRepository(rep);
     //TODO: Return a specific id.
 }
 public static Repository RepositoryFromString(string line)
 {
     Regex regex = new Regex(@"(\S*) (\S*) (\S*)");
     Match match = regex.Match(line);
     Repository repository = new Repository();
     repository.Id = match.Groups[2].Value;
     repository.Name = match.Groups[3].Value;
     repository.Server = match.Groups[4].Value;
     return repository;
 }
        /// <summary>
        /// Creates a new repository with the specified information
        /// </summary>
        /// <param name="rep">Repository to create</param>
        public static void CreateRepository(Repository rep)
        {
            if (string.IsNullOrEmpty(rep.Server))
                throw new ArgumentException("Repository server cannot be null");

            if (string.IsNullOrEmpty(rep.Name))
                throw new ArgumentException("Repository name cannot be null");

            Process p = GetCmProcess();
            p.StartInfo.Arguments = "mkrep " + rep.Server + " " + rep.Name;
            p.Start();
        }