예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SearchCommitsRequest"/> class.
        /// </summary>
        /// <param name="term">The term.</param>
        /// <param name="owner">The owner.</param>
        /// <param name="name">The name.</param>
        public SearchCommitsRequest(string term, string owner, string name)
            : this(term)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
            Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));

            Repos.Add(owner, name);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SearchCodeRequest"/> class.
        /// </summary>
        /// <param name="term">The term.</param>
        /// <param name="owner">The owner.</param>
        /// <param name="name">The name.</param>
        public SearchCodeRequest(string term, string owner, string name)
            : this(term)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            Repos.Add(owner, name);
        }
예제 #3
0
 public void AddRepos(List <CRepo> repos)
 {
     foreach (var repo in repos)
     {
         if (this.Repos.Exists(r => r.Name == repo.Name))
         {
             continue;
         }
         Repos.Add(repo);
     }
 }
예제 #4
0
        public static void AddRepo(string name, IRepository repo)
        {
            if (String.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException("name");
            }

            if (repo == null)
            {
                throw new ArgumentNullException("repo");
            }

            Repos.Add(name, repo);
        }
예제 #5
0
        private void LoadConfiguration()
        {
            var config = (SVNConfiguration)ConfigurationManager.GetSection("SVN");

            foreach (SVNConfiguration.Repository repo in config.Repos)
            {
                if (DBUtils.ReposExists(repo.Url))
                {
                    log.DebugFormat("Repository exists, getting in database : {0}", repo.Url);
                    Repos.Add(DBUtils.GetRepository(repo.Url));
                }
                else
                {
                    log.DebugFormat("Repo {0} not exist, creating a new one", repo.Url);
                    var repository = new SVNRepository(repo.Url);
                    Repos.Add(repository);
                }
            }
        }
예제 #6
0
        private void InitialCurrentRepos()
        {
            IList <Repo> currentRepos;
            var          repoNames = new List <string>();

            assembly = Assembly.LoadFrom(currentDllPath);

            var repoTypes = from t in assembly.GetTypes()
                            where !string.IsNullOrEmpty(t.Namespace) && t.Namespace.Contains("Repo") && t.Name.Contains("Repo")
                            select t;


            if (!Repos.Keys.Contains(currentDllPath))
            {
                currentRepos = new List <Repo>();
                Repos.Add(currentDllPath, currentRepos);
            }
            else
            {
                currentRepos = CurrentRepos;
            }

            foreach (var repoType in repoTypes)
            {
                repoNames.Add(repoType.Name);
                var tempRepo = currentRepos.SingleOrDefault(r => r.Name == repoType.Name);
                if (tempRepo != null)
                {
                    tempRepo.MergeRepoType(repoType);
                }
                else
                {
                    currentRepos.Add(new Repo(repoType));
                }
            }

            foreach (var repo in currentRepos.Where(r => !repoNames.Contains(r.Name)))
            {
                currentRepos.Remove(repo);
            }
        }
예제 #7
0
 public static void AddDocumentDbRepo(DocumentClient client, string dbName, string collectionName)
 {
     Repos.Add(collectionName, new DocumentDbRepo(dbName, collectionName, client));
 }