コード例 #1
0
        private void InstallComponentFromRecord(string tmpRecord, ComponentReference comp)
        {
            Uri             compXmlUri    = new Uri("component.xml", UriKind.Relative);
            ComponentRecord compRecord    = ComponentRecord.Load(tmpRecord);
            var             versionRecord = compRecord.Versions.Find(v => v.Version == comp.LatestVersion);

            _componentDownloader.DownloadFileAsync(compXmlUri, tmpRecord);
        }
コード例 #2
0
        // download "component.xml" for specified component
        private void InstallOrUpdateComponent(ComponentReference comp)
        {
            string tmpFile   = Path.GetTempFileName();
            var    webClient = new ImpatientWebClient {
                BaseAddress = "http://140.176.10.7:8000/cintron/BioInfoTerminal.git"
            };

            webClient.DownloadFileCompleted += (obj, args) =>
            {
                InstallComponentFromRecord(tmpFile, comp);
                File.Delete(tmpFile);
            };
            Uri compXmlUri = new Uri("component.xml", UriKind.Relative);

            webClient.ImpatientAsyncDownload(compXmlUri, tmpFile);
        }