Beispiel #1
0
        public string DescargarFuentes(Repositorio repo)
        {
            packageListUrl = repo.URL + "/packageList.xml";
            Repo = repo;

            WebClient w = new WebClient();
            string destinyFile= Program.DIR_CACHE + @"\" + Repo.RepoName.Replace(" ", "") + "packageList.xml";
            Console.Write("Descargando de: " + Repo.RepoName + ".......");
            linea = 0;

            w.DownloadFileAsync(new Uri(packageListUrl, UriKind.Absolute), destinyFile );

            w.DownloadProgressChanged += w_DownloadProgressChanged;
            w.DownloadFileCompleted += w_DownloadFileCompleted;

            return destinyFile;
        }
Beispiel #2
0
        /// <summary>
        /// Obtiene la lista de repositorios
        /// </summary>
        /// <returns></returns>
        public List<Repositorio> ObtenerRepositorios()
        {
            XDocument doc = CargarSources();
            List<Repositorio> lista = new List<Repositorio>();

            var repos = from u in doc.Elements("conf").Elements("repos").Elements()
                        select u;

            if (repos != null)
            {
                Repositorio rtmp = null;

                foreach (var rxml in repos)
                {
                    rtmp = new Repositorio();
                    rtmp.RepoName = rxml.Attribute("name").Value.ToString();
                    rtmp.URL = rxml.Attribute("url").Value.ToString();
                    lista.Add(rtmp);
                }
            }

            LiberarMemoria(doc);
            return lista;
        }