Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
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;
        }