diff options
author | sr55 <[email protected]> | 2007-12-19 22:10:27 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2007-12-19 22:10:27 +0000 |
commit | 5757d7c7295572f8dd8f078dcceddf8728e075f3 (patch) | |
tree | 10cd21ca48ae8f148fbe12aa5be3f17c1e47ef3a /win/C#/Functions | |
parent | 9edd509f7e84d131107f523219032f221a355e56 (diff) |
WinGui:
- Some code clean up + removal of old unused code.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1137 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions')
-rw-r--r-- | win/C#/Functions/CLI.cs | 23 | ||||
-rw-r--r-- | win/C#/Functions/RssReader.cs | 95 |
2 files changed, 34 insertions, 84 deletions
diff --git a/win/C#/Functions/CLI.cs b/win/C#/Functions/CLI.cs index 259a98c3a..b0b79d32f 100644 --- a/win/C#/Functions/CLI.cs +++ b/win/C#/Functions/CLI.cs @@ -60,28 +60,5 @@ namespace Handbrake.Functions }
return hbProc;
}
-
- public void killCLI()
- {
- try
- {
- hbProc.Kill();
- }
- catch (Exception)
- {
- // No need to do anything. Chances are the process was already dead.
- }
- }
-
- public void closeCLI()
- {
- hbProc.Close();
- hbProc.Dispose();
- }
-
- public void setNull()
- {
- hbProc = new Process();
- }
}
}
diff --git a/win/C#/Functions/RssReader.cs b/win/C#/Functions/RssReader.cs index 36d105d8d..ce8dd568b 100644 --- a/win/C#/Functions/RssReader.cs +++ b/win/C#/Functions/RssReader.cs @@ -55,11 +55,14 @@ namespace Handbrake.Functions return latestTitle;
}
+ private string hb_versionInfo;
+ private string hb_version;
+ private string hb_build;
+ private string hb_file;
- public string versionInfo()
+ public void getInfo()
{
readRss();
- string vinfo = "";
for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)
{
if (nodeChannel.ChildNodes[6].Name == "item")
@@ -68,79 +71,49 @@ namespace Handbrake.Functions t = readRss();
if (nodeItem["title"].InnerText == t)
{
- vinfo = nodeItem["description"].InnerText;
- break;
- }
- }
- }
+ // Get the Version Information
+ hb_versionInfo = nodeItem["description"].InnerText;
- return vinfo;
- }
-
- public string version()
- {
- readRss();
- string vinfo = "";
- for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)
- {
- if (nodeChannel.ChildNodes[6].Name == "item")
- {
- nodeItem = nodeChannel.ChildNodes[0];
- string t = readRss();
- if (nodeItem["title"].InnerText == t)
- {
+ // Get the version
string input = nodeItem.InnerXml;
Match ver = Regex.Match(input, @"sparkle:shortVersionString=""([0-9].[0-9].[0-9]*)\""");
- vinfo = ver.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");
+ hb_version = ver.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");
+
+ // Get the build number
+ input = nodeItem.InnerXml;
+ ver = Regex.Match(input, @"sparkle:version=""([0-9]*)\""");
+ hb_build = ver.ToString().Replace("sparkle:version=", "").Replace("\"", "");
+
+ // Get the update file
+ hb_file = nodeItem["windows"].InnerText;
- break;
}
}
}
- return vinfo;
+ }
+
+ public string versionInfo()
+ {
+ getInfo();
+ return hb_versionInfo;
+ }
+
+ public string version()
+ {
+ getInfo();
+ return hb_version;
}
public string build()
{
- readRss();
- string vinfo = "";
- for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)
- {
- if (nodeChannel.ChildNodes[6].Name == "item")
- {
- nodeItem = nodeChannel.ChildNodes[0];
- string t = readRss();
- if (nodeItem["title"].InnerText == t)
- {
- string input = nodeItem.InnerXml;
- Match ver = Regex.Match(input, @"sparkle:version=""([0-9]*)\""");
- vinfo = ver.ToString().Replace("sparkle:version=", "").Replace("\"", "");
- break;
- }
- }
- }
- return vinfo;
+ getInfo();
+ return hb_build;
}
public string downloadFile()
{
- readRss();
- string file = "";
- for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)
- {
- if (nodeChannel.ChildNodes[6].Name == "item")
- {
- nodeItem = nodeChannel.ChildNodes[0];
- t = readRss();
- if (nodeItem["title"].InnerText == t)
- {
- file = nodeItem["windows"].InnerText;
- break;
- }
- }
- }
-
- return file;
- }
+ getInfo();
+ return hb_file;
+ }
}
}
\ No newline at end of file |