/// <summary> /// Get the Remote Version of an Addon /// </summary> public void CheckRemote() { var addonSite = AddonSiteBase.GetSite(AddonSiteId); RemoteVersion = addonSite.GetVersion(this); LastUpdated = addonSite.GetLastUpdated(this); // Hack to fire Property Changed Addon.PreferredMapping = Addon.PreferredMapping; }
private void CreateMappings(string tag, AddonSiteId siteId) { txtOut.Text = string.Empty; var tagList = tag.Split(','); foreach (var itTag in tagList) { var currTag = itTag.Trim(); try { var site = AddonSiteBase.GetSite(siteId); var map = new Mapping(siteId, currTag) { Addon = new Addon("tag") }; var downLink = site.GetFilePath(map); var archiveFilePath = WebHelper.DownloadFileToTemp(downLink); var cont = ArchiveHelper.GetArchiveContent(archiveFilePath); var folderList = new List <string>(); foreach (var s in cont) { var index = s.IndexOf("\\"); if (index > 0) { Helpers.AddIfNeeded(folderList, s.Substring(0, index)); } } var main = string.Empty; for (var i = 0; i < folderList.Count; i++) { var s = folderList[i]; if (i == 0) { txtOut.Text += string.Format(@"GetAddon(""{0}"").Mappings.Add(new Mapping(""{1}"", AddonSiteId.{2}));{3}", s, currTag, siteId, Environment.NewLine); main = s; } else { txtOut.Text += string.Format(@"GetAddon(""{0}"").SubAddons.Add(GetAddon(""{1}""));{2}", main, s, Environment.NewLine); } } } catch { txtOut.Text += string.Format(@"Tag ""{0}"" failed{1}", currTag, Environment.NewLine); } txtOut.Text += Environment.NewLine; Application.DoEvents(); //System.Threading.Thread.Sleep(1000); } }
public string GetFilePath() { var site = AddonSiteBase.GetSite(AddonSiteId); return(site.GetFilePath(this)); }
public string GetInfoLink() { var site = AddonSiteBase.GetSite(AddonSiteId); return(site.GetInfoLink(this)); }
public string GetChangeLog() { var site = AddonSiteBase.GetSite(AddonSiteId); return(site.GetChangeLog(this)); }