2 using System.Collections.Generic;
\r
3 using System.ComponentModel;
\r
5 using System.Drawing;
\r
7 using System.Windows.Forms;
\r
10 using System.Text.RegularExpressions;
\r
12 namespace Handbrake.Functions
\r
16 XmlTextReader rssReader;
\r
19 XmlNode nodeChannel;
\r
23 private string readRss()
\r
25 rssReader = new XmlTextReader("http://handbrake.m0k.org/appcast.xml");
\r
26 rssDoc = new XmlDocument();
\r
27 rssDoc.Load(rssReader);
\r
29 for (int i = 0; i < rssDoc.ChildNodes.Count; i++)
\r
31 if (rssDoc.ChildNodes[i].Name == "rss")
\r
33 nodeRss = rssDoc.ChildNodes[i];
\r
37 for (int i = 0; i < nodeRss.ChildNodes.Count; i++)
\r
39 if (nodeRss.ChildNodes[i].Name == "channel")
\r
41 nodeChannel = nodeRss.ChildNodes[i];
\r
45 string latestTitle = "";
\r
46 for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)
\r
49 if (nodeChannel.ChildNodes[i].Name == "item")
\r
51 nodeItem = nodeChannel.ChildNodes[i];
\r
52 latestTitle = nodeItem["title"].InnerText;
\r
58 private string hb_versionInfo;
\r
59 private string hb_version;
\r
60 private string hb_build;
\r
61 private string hb_file;
\r
63 public void getInfo()
\r
66 for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)
\r
68 if (nodeChannel.ChildNodes[6].Name == "item")
\r
70 nodeItem = nodeChannel.ChildNodes[0];
\r
72 if (nodeItem["title"].InnerText == t)
\r
74 // Get the Version Information
\r
75 hb_versionInfo = nodeItem["description"].InnerText;
\r
78 string input = nodeItem.InnerXml;
\r
79 Match ver = Regex.Match(input, @"sparkle:shortVersionString=""([0-9].[0-9].[0-9]*)\""");
\r
80 hb_version = ver.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");
\r
82 // Get the build number
\r
83 input = nodeItem.InnerXml;
\r
84 ver = Regex.Match(input, @"sparkle:version=""([0-9]*)\""");
\r
85 hb_build = ver.ToString().Replace("sparkle:version=", "").Replace("\"", "");
\r
87 // Get the update file
\r
88 hb_file = nodeItem["windows"].InnerText;
\r
95 public string versionInfo()
\r
98 return hb_versionInfo;
\r
101 public string version()
\r
107 public string build()
\r
113 public string downloadFile()
\r