-using System;\r
+/* DVD.cs $\r
+ \r
+ This file is part of the HandBrake source code.\r
+ Homepage: <http://handbrake.fr>.\r
+ It may be used under the terms of the GNU General Public License. */\r
+\r
using System.Collections.Generic;\r
-using System.ComponentModel;\r
-using System.Data;\r
-using System.Drawing;\r
-using System.Text;\r
-using System.Text.RegularExpressions; \r
-using System.Windows.Forms;\r
using System.IO;\r
-using System.Threading;\r
-using System.Diagnostics;\r
\r
namespace Handbrake.Parsing\r
{\r
- \r
/// <summary>\r
/// An object representing a scanned DVD\r
/// </summary>\r
public class DVD\r
{\r
+ private readonly List<Title> m_titles;\r
\r
- private List<Title> m_titles;\r
/// <summary>\r
- /// Collection of Titles associated with this DVD\r
+ /// Default constructor for this object\r
/// </summary>\r
- public List<Title> Titles\r
+ public DVD()\r
{\r
- get\r
- {\r
- return this.m_titles;\r
- }\r
+ m_titles = new List<Title>();\r
}\r
\r
/// <summary>\r
- /// Default constructor for this object\r
+ /// Collection of Titles associated with this DVD\r
/// </summary>\r
- public DVD()\r
+ public List<Title> Titles\r
{\r
- this.m_titles = new List<Title>();\r
+ get { return m_titles; }\r
}\r
\r
public static DVD Parse(StreamReader output)\r
{\r
- DVD thisDVD = new DVD();\r
- try\r
- {\r
- while (!output.EndOfStream)\r
- {\r
- if ((char)output.Peek() == '+')\r
- {\r
- thisDVD.m_titles.AddRange(Title.ParseList(output.ReadToEnd()));\r
- }\r
- else\r
- {\r
- output.ReadLine();\r
- }\r
- }\r
- }\r
- catch (Exception exc)\r
+ var thisDVD = new DVD();\r
+\r
+ while (!output.EndOfStream)\r
{\r
- MessageBox.Show("DVD.CS - Parse" + exc.ToString());\r
+ if ((char) output.Peek() == '+')\r
+ thisDVD.m_titles.AddRange(Title.ParseList(output.ReadToEnd()));\r
+ else\r
+ output.ReadLine();\r
}\r
+\r
return thisDVD;\r
}\r
}\r
-}\r
+}
\ No newline at end of file