Exemplo n.º 1
0
 public void ShowFirebwallUpdate()
 {
     if (this.InvokeRequired)
     {
         System.Threading.ThreadStart ts = new System.Threading.ThreadStart(ShowFirebwallUpdate);
         this.Invoke(ts);
     }
     else
     {
         this.Visible = true;
         meta = UpdateChecker.availableFirebwall;
         this.Text = "New Version: fireBwall " + meta.version;
         textBox1.Text = "New Version: fireBwall " + meta.version + "\r\n" + meta.Description + "\r\n\r\nChange Log:\r\n";
         foreach (string s in meta.changelog)
         {
             textBox1.Text += "\t- " + s + "\r\n";
         }
         LanguageChanged();
         ThemeChanged();                
     }
 }
Exemplo n.º 2
0
 public void UpdateFirebwallMetaVersion()
 {
     try
     {
         WebClient client = new WebClient();
         client.Headers[HttpRequestHeader.UserAgent] = "firebwall 0.3.12.0 Updater";
         string xml = client.DownloadString("https://www.firebwall.com/api/firebwall/" + GeneralConfiguration.Instance.PreferredLanguage + ".xml?min=" + GeneralConfiguration.Instance.IntervaledUpdateMinutes.ToString());
         XmlTextReader reader = new XmlTextReader(new MemoryStream(Encoding.UTF8.GetBytes(xml)));
         lock (padlock)
         {
             if (!reader.Read())
             {
                 availableFirebwall = null;
                 reader.Close();
                 return;
             }
             availableFirebwall = new fireBwallMetaData();
             while (reader.Read())
             {
                 switch (reader.NodeType)
                 {
                     case XmlNodeType.Element:
                         if (reader.Name == "current")
                         {
                             availableFirebwall.version = reader.GetAttribute("version");
                         }
                         else if (reader.Name == "filename")
                         {
                             reader.Read();
                             if (reader.NodeType == XmlNodeType.Text)
                                 availableFirebwall.filename = reader.Value;
                         }
                         else if (reader.Name == "description")
                         {
                             reader.Read();
                             if (reader.NodeType == XmlNodeType.Text)
                                 availableFirebwall.Description = reader.Value;
                         }
                         else if (reader.Name == "entry")
                         {
                             reader.Read();
                             if (reader.NodeType == XmlNodeType.Text)
                                 availableFirebwall.changelog.Add(reader.Value);
                         }
                         else if (reader.Name == "downloadurl")
                         {
                             reader.Read();
                             if (reader.NodeType == XmlNodeType.Text)
                                 availableFirebwall.downloadUrl = reader.Value;
                         }
                         else if (reader.Name == "imageurl")
                         {
                             reader.Read();
                             if (reader.NodeType == XmlNodeType.Text)
                                 availableFirebwall.imageUrl = reader.Value;
                         }
                         else if (reader.Name == "url")
                         {
                             reader.Read();
                             if (reader.NodeType == XmlNodeType.Text)
                             {
                                 availableFirebwall.screenShotUrls.Add(reader.Value);
                             }
                         }
                         break;
                 }
             }
         }
     }
     catch { }
 }
Exemplo n.º 3
0
 public void UpdateFirebwallMetaVersion()
 {
     try
     {
         WebClient client = new WebClient();
         client.Headers[HttpRequestHeader.UserAgent] = "firebwall 0.3.12.0 Updater";
         string        xml    = client.DownloadString("https://www.firebwall.com/api/firebwall/" + GeneralConfiguration.Instance.PreferredLanguage + ".xml?min=" + GeneralConfiguration.Instance.IntervaledUpdateMinutes.ToString());
         XmlTextReader reader = new XmlTextReader(new MemoryStream(Encoding.UTF8.GetBytes(xml)));
         lock (padlock)
         {
             if (!reader.Read())
             {
                 availableFirebwall = null;
                 reader.Close();
                 return;
             }
             availableFirebwall = new fireBwallMetaData();
             while (reader.Read())
             {
                 switch (reader.NodeType)
                 {
                 case XmlNodeType.Element:
                     if (reader.Name == "current")
                     {
                         availableFirebwall.version = reader.GetAttribute("version");
                     }
                     else if (reader.Name == "filename")
                     {
                         reader.Read();
                         if (reader.NodeType == XmlNodeType.Text)
                         {
                             availableFirebwall.filename = reader.Value;
                         }
                     }
                     else if (reader.Name == "description")
                     {
                         reader.Read();
                         if (reader.NodeType == XmlNodeType.Text)
                         {
                             availableFirebwall.Description = reader.Value;
                         }
                     }
                     else if (reader.Name == "entry")
                     {
                         reader.Read();
                         if (reader.NodeType == XmlNodeType.Text)
                         {
                             availableFirebwall.changelog.Add(reader.Value);
                         }
                     }
                     else if (reader.Name == "downloadurl")
                     {
                         reader.Read();
                         if (reader.NodeType == XmlNodeType.Text)
                         {
                             availableFirebwall.downloadUrl = reader.Value;
                         }
                     }
                     else if (reader.Name == "imageurl")
                     {
                         reader.Read();
                         if (reader.NodeType == XmlNodeType.Text)
                         {
                             availableFirebwall.imageUrl = reader.Value;
                         }
                     }
                     else if (reader.Name == "url")
                     {
                         reader.Read();
                         if (reader.NodeType == XmlNodeType.Text)
                         {
                             availableFirebwall.screenShotUrls.Add(reader.Value);
                         }
                     }
                     break;
                 }
             }
         }
     }
     catch { }
 }