diff options
author | sr55 <[email protected]> | 2012-02-15 20:03:10 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-02-15 20:03:10 +0000 |
commit | 1d8bc5dd7d36da0167e572762b6f20db20289012 (patch) | |
tree | 20e3a5164ff24bb6d44504e587fb14dc9a92d5bd /win/CS/Functions | |
parent | 4da15bcbbbd800b7af230294224f0d7248e8dd72 (diff) |
WinGui: Fix a couple of trival gui bugs and force all exceptions to be handled by the built-in exception handler rather than the .NET one.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4449 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/Functions')
-rw-r--r-- | win/CS/Functions/Main.cs | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/win/CS/Functions/Main.cs b/win/CS/Functions/Main.cs index 9411fc151..42b103498 100644 --- a/win/CS/Functions/Main.cs +++ b/win/CS/Functions/Main.cs @@ -100,19 +100,21 @@ namespace Handbrake.Functions IDictionary<int, string> chapterMap = new Dictionary<int, string>();
try
{
- StreamReader sr = new StreamReader(filename);
- string csv = sr.ReadLine();
- while (csv != null)
+ using (StreamReader sr = new StreamReader(filename))
{
- if (csv.Trim() != string.Empty)
+ string csv = sr.ReadLine();
+ while (csv != null)
{
- csv = csv.Replace("\\,", "<!comma!>");
- string[] contents = csv.Split(',');
- int chapter;
- int.TryParse(contents[0], out chapter);
- chapterMap.Add(chapter, contents[1].Replace("<!comma!>", ","));
+ if (csv.Trim() != string.Empty)
+ {
+ csv = csv.Replace("\\,", "<!comma!>");
+ string[] contents = csv.Split(',');
+ int chapter;
+ int.TryParse(contents[0], out chapter);
+ chapterMap.Add(chapter, contents[1].Replace("<!comma!>", ","));
+ }
+ csv = sr.ReadLine();
}
- csv = sr.ReadLine();
}
}
catch (Exception)
@@ -156,7 +158,7 @@ namespace Handbrake.Functions }
catch (Exception exc)
{
- throw new GeneralApplicationException("Unable to save Chapter Makrers file! ", "Chapter marker names will NOT be saved in your encode.", exc);
+ throw new GeneralApplicationException("Unable to save the chapter information to csv.", "The file may already be in use by another application.", exc);
}
}
|