コード例 #1
0
ファイル: ToolStoreDlg.cs プロジェクト: CMRI-ProCan/pwiz
 private static string FormatVersionText(ToolStoreItem tool)
 {
     if (!tool.Installed && !tool.IsMostRecentVersion)
     {
         return(string.Format(Resources.ToolStoreDlg_FormatVersionText_Not_currently_installed__Version___0__is_available, tool.Version));
     }
     else if (!tool.IsMostRecentVersion)
     {
         return
             (string.Format(
                  Resources.ToolStoreDlg_FormatVersionText_Version__0__currently_installed__Version__1__is_available_,
                  ToolStoreUtil.GetCurrentVersion(tool.Identifier), tool.Version));
     }
     else
     {
         return(string.Format(Resources.ToolStoreDlg_FormatVersionText_Currently_installed_and_fully_updated__Version___0___,
                              ToolStoreUtil.GetCurrentVersion(tool.Identifier)));
     }
 }
コード例 #2
0
ファイル: ToolStoreDlg.cs プロジェクト: CMRI-ProCan/pwiz
 public ToolStoreItem(string name,
                      string authors,
                      string providers,
                      string version,
                      string description,
                      string identifier,
                      Image toolImage,
                      string filePath = null)
 {
     Name                = name;
     Authors             = authors;
     Provider            = providers;
     Version             = version;
     Description         = description;
     Identifier          = identifier;
     ToolImage           = toolImage;
     Installed           = ToolStoreUtil.IsInstalled(identifier);
     IsMostRecentVersion = ToolStoreUtil.IsMostRecentVersion(identifier, version);
     FilePath            = filePath;
 }
コード例 #3
0
        public ToolStoreItem(string name,
                             string authors,
                             string organization,
                             string provider,
                             string version,
                             string description,
                             string identifier,
                             string languages,
                             string iconUrl,
                             string downloadUrl)
        {
            Name         = name;
            Authors      = authors;
            Organization = organization;
            Provider     = provider;
            Version      = version;
            // ReSharper disable LocalizableElement
            Description = description != null?description.Replace("\n", Environment.NewLine) : null;

            // ReSharper restore LocalizableElement
            Identifier = identifier;
            Languages  = languages;
            ToolImage  = ToolStoreUtil.DefaultImage;
            if (iconUrl != null)
            {
                IconDownloading = true;
                var iconUri   = new Uri(WebToolStoreClient.TOOL_STORE_URI + iconUrl);
                var webClient = new WebClient();
                webClient.DownloadDataCompleted += DownloadIconDone;
                webClient.DownloadDataAsync(iconUri);
            }
            Installed           = ToolStoreUtil.IsInstalled(identifier);
            IsMostRecentVersion = ToolStoreUtil.IsMostRecentVersion(identifier, version);
            UriBuilder uri = new UriBuilder(WebToolStoreClient.TOOL_STORE_URI)
            {
                Path  = WebToolStoreClient.TOOL_DETAILS_URL,
                Query = @"name=" + Uri.EscapeDataString(name)
            };

            FilePath = uri.Uri.AbsoluteUri;
        }
コード例 #4
0
        public string GetToolZipFile(ILongWaitBroker waitBroker, string packageIdentifier, string directory)
        {
            var client = ToolStoreUtil.CreateClient();

            return(client.GetToolZipFile(waitBroker, packageIdentifier, directory));
        }