public event EventHandler QueueCompleted;\r
\r
#region Queue\r
+\r
/// <summary>\r
/// Gets and removes the next job in the queue.\r
/// </summary>\r
/// </param>\r
public void Add(string query, string source, string destination, bool customJob)\r
{\r
- Job newJob = new Job { Id = this.nextJobId++, Query = query, Source = source, Destination = destination, CustomQuery = customJob };\r
+ Job newJob = new Job\r
+ {\r
+ Id = this.nextJobId++, \r
+ Query = query, \r
+ Source = source, \r
+ Destination = destination, \r
+ CustomQuery = customJob\r
+ };\r
\r
this.queue.Add(newJob);\r
this.WriteQueueStateToFile("hb_queue_recovery.xml");\r
/// <param name="file">The location of the file to write the queue to.</param>\r
public void WriteQueueStateToFile(string file)\r
{\r
- string appDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\hb_queue_recovery.xml");\r
+ string appDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), \r
+ @"HandBrake\hb_queue_recovery.xml");\r
string tempPath = file == "hb_queue_recovery.xml" ? appDataPath : file;\r
\r
try\r
using (FileStream strm = new FileStream(tempPath, FileMode.Create, FileAccess.Write))\r
{\r
if (serializer == null)\r
- serializer = new XmlSerializer(typeof(List<Job>));\r
+ serializer = new XmlSerializer(typeof (List<Job>));\r
serializer.Serialize(strm, queue);\r
strm.Close();\r
strm.Dispose();\r
line.WriteLine(strCmdLine);\r
}\r
\r
- MessageBox.Show("Your batch script has been sucessfully saved.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
+ MessageBox.Show("Your batch script has been sucessfully saved.", "Status", MessageBoxButtons.OK, \r
+ MessageBoxIcon.Asterisk);\r
}\r
catch (Exception)\r
{\r
- MessageBox.Show("Unable to write to the file. Please make sure that the location has the correct permissions for file writing.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
+ MessageBox.Show(\r
+ "Unable to write to the file. Please make sure that the location has the correct permissions for file writing.", \r
+ "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
}\r
-\r
}\r
}\r
\r
/// <param name="file">The location of the file to read the queue from.</param>\r
public void LoadQueueFromFile(string file)\r
{\r
- string appDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\hb_queue_recovery.xml");\r
+ string appDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), \r
+ @"HandBrake\hb_queue_recovery.xml");\r
string tempPath = file == "hb_queue_recovery.xml" ? appDataPath : file;\r
\r
if (File.Exists(tempPath))\r
if (strm.Length != 0)\r
{\r
if (serializer == null)\r
- serializer = new XmlSerializer(typeof(List<Job>));\r
+ serializer = new XmlSerializer(typeof (List<Job>));\r
\r
List<Job> list = serializer.Deserialize(strm) as List<Job>;\r
\r
\r
// Growl\r
if (Properties.Settings.Default.growlEncode)\r
- GrowlCommunicator.Notify("Encode Completed", "Put down that cocktail...\nyour Handbrake encode is done.");\r
+ GrowlCommunicator.Notify("Encode Completed", \r
+ "Put down that cocktail...\nyour Handbrake encode is done.");\r
\r
while (this.PauseRequested) // Need to find a better way of doing this.\r
{\r