Exemple #1
0
        public Repository(string filepath)
        {
            MfilName = System.IO.Path.GetFileName(filepath);
            FilePath = filepath.Replace(MfilName, "");
            Type     = FilePath.Contains("direct") ? RepoType.Direct : RepoType.Streamed;

            Match match = Regex.Match(MfilName, @"(wow[tb]?)-(\d+)-", RegexOptions.Compiled | RegexOptions.IgnoreCase);

            if (match.Success)
            {
                var(branch, build, region) = ExtractInfo(match);

                if (!RepositoriesManager.Builds.TryGetValue(build, out string buildname))
                {
                    buildname = "0.0.0";
                }

                VersionName      = $"{buildname}.{build} - {branch} {region}".Trim();
                DefaultDirectory = $"{build}patch{buildname}" + System.IO.Path.DirectorySeparatorChar;

                Valid = true;
            }
            else
            {
                Program.Log("Invalid Mfil " + MfilName, System.ConsoleColor.Yellow);
                Valid = false;
            }
        }
Exemple #2
0
 public Repo(Repository repository, IEnumerable <Issue> issues)
 {
     Repository    = repository;
     IssueComments = new Dictionary <Issue, ObservableCollection <Comment> >();
     Issues        = new ObservableCollection <Issue>(issues);
     Type          = RepoType.None;
 }
 public IRepositorio getRepositorio(RepoType repoType)
 {
     IRepositorio repo = null;
     switch (repoType) {
         case RepoType.ADMINISTRADOR:
             repo = new clsRepositorioAdministrador();
             break;
         case RepoType.ALUMNO:
             repo = new clsRepositorioAlumno();
             break;
         case RepoType.CURSO:
             repo = new clsRepositorioCurso();
             break;
         case RepoType.INSCRIPCION:
             repo = new clsRepositorioInscripcion();
             break;
         case RepoType.PROFESOR:
             repo = new clsRepositorioProfesor();
             break;
         case RepoType.CUOTA:
             repo = new clsRepositorioCuota();
             break;
         case RepoType.NOTA:
             repo = new clsRepositorioNota();
             break;
     }
     return repo;
 }
Exemple #4
0
        public override void Unregister(IGitUICommands gitUiCommands)
        {
            if (IsSvnRepo(gitUiCommands))
            {
                RemoveSvnScripts();
            }

            repoType = RepoType.Unknown;
        }
 Repo(Uri uri, RepoType type)
 {
     if (uri == null)
     {
         throw new ArgumentNullException(nameof(uri));
     }
     Uri  = uri;
     Type = type;
 }
Exemple #6
0
        /// <summary>
        /// Checks if repo has a SVN remote.
        /// </summary>
        /// <returns>
        /// true if has SVN remote; false otherwise.
        /// </returns>
        private bool IsSvnRepo(IGitUICommands gitUiCommands)
        {
            if (repoType == RepoType.Unknown)
            {
                ExecutionResult result = gitUiCommands.GitModule.GitExecutable.Execute(cmdInfo);
                repoType = (result.ExitCode == 0) ? RepoType.SVN
                                                  : RepoType.git;
            }

            return(repoType == RepoType.SVN);
        }
Exemple #7
0
        protected override void Load(ContainerBuilder builder)
        {
            switch (RepoType.ToLowerInvariant())
            {
            case "database":
                RegisterDatabaseRepo(builder);
                break;

            case "file":
                RegisterFileRepo(builder);
                break;

            case "default":
            default:
                RegisterDefaultRepo(builder);
                break;
            }
        }
Exemple #8
0
        public static Repository SelectRepository(RepoType type)
        {
            var repos = RepositoriesManager.GetByType(type);

            Program.Log("Which version of World of Warcraft do you want to restore :");
            Program.Log();

            for (int i = 0; i < repos.Count; i++)
            {
                Program.Log("[" + (i + 1).ToString("000") + "] " + repos[i].VersionName);
            }

            Program.Log();
            Program.Log("Select version :");
            int selectedIndex = HandleUserParams(repos.Count);

            return(repos[selectedIndex]);
        }
Exemple #9
0
        private static void EntryPointNewSession()
        {
            RepoType     repoType   = UserInputs.SelectRepositoryType();
            Repository   repository = UserInputs.SelectRepository(repoType);
            ManifestFile manifest   = ManifestFile.FromRepository(repository);

            if (manifest == null)
            {
                return;
            }

            string locale = UserInputs.SelectLocale(manifest);
            string os     = UserInputs.SelectOs();

            CurrentSession = new Session(repository.MfilName, locale, os);
            CurrentSession.SaveSession();
            StartProcess(manifest);
        }
        public static IRepo SqlRepo()
        {
            // This should be moved to ini file and red from there
            RepoType rType = RepoType.Sql;

            switch (rType)
            {
            case RepoType.Sql:
                return(new SqlRepo());

            case RepoType.Txt:
                return(new TxtRepo());

            default:
                break;
            }
            return(null);
        }
        private RepoType GetRepoType()
        {
            _repoType = RepoType.None;
            if (!HasRepo)
            {
                _repoType = RepoType.None;
            }
            else if (Directory.GetFiles(Utilities.HgDataFolder(_repoFolder), "*.lift.i").Any())
            {
                _repoType = RepoType.LIFT;
            }
            else if (Directory.GetFiles(Utilities.HgDataFolder(_repoFolder), "*._custom_properties.i").Any())
            {
                _repoType = RepoType.FLEx;
            }
            else
            {
                _repoType = RepoType.NotSupported;
            }

            return(_repoType);
        }
Exemple #12
0
        public static Uri CombineUrl(string normalizedRepoUrl, string refName, string relativePathToRepoRoot, RepoType repoType)
        {
            switch (repoType)
            {
            case RepoType.GitHub:
                return(new Uri(Path.Combine(normalizedRepoUrl, "blob", refName, relativePathToRepoRoot)));

            case RepoType.Vso:
                var rootedPathToRepo = "/" + relativePathToRepoRoot.ToNormalizedPath();
                return(new Uri($"{normalizedRepoUrl}?path={HttpUtility.UrlEncode(rootedPathToRepo)}&version=GB{HttpUtility.UrlEncode(refName)}&_a=contents"));

            default:
                throw new NotSupportedException($"RepoType '{repoType}' is not supported.");
            }
        }
		private RepoType GetRepoType()
		{
			_repoType = RepoType.None;
			if (!HasRepo)
			{
				_repoType = RepoType.None;
			}
			else if (Directory.GetFiles(Utilities.HgDataFolder(_repoFolder), "*.lift.i").Any())
			{
				_repoType = RepoType.LIFT;
			}
			else if (Directory.GetFiles(Utilities.HgDataFolder(_repoFolder), "*._custom_properties.i").Any())
			{
				_repoType = RepoType.FLEx;
			}
			else
			{
				_repoType = RepoType.NotSupported;
			}

			return _repoType;
		}
Exemple #14
0
 public static IReadOnlyList <Repository> GetByType(RepoType type)
 {
     return(Repositories.Where(x => x.Type == type).ToList());
 }
 Repo(Uri uri, RepoType type) {
     Contract.Requires<ArgumentNullException>(uri != null);
     Uri = uri;
     Type = type;
 }
Exemple #16
0
 public Repo()
 {
     Issues        = new ObservableCollection <Issue>();
     IssueComments = new Dictionary <Issue, ObservableCollection <Comment> >();
     Type          = RepoType.None;
 }
Exemple #17
0
 public RepoAPI(RepoType type)
 {
     repoType = type;
 }