OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / EncodeQueue / Queue.cs
index 891c2de..d31caf9 100644 (file)
@@ -45,6 +45,7 @@ namespace Handbrake.EncodeQueue
         public event EventHandler QueueCompleted;\r
 \r
         #region Queue\r
+\r
         /// <summary>\r
         /// Gets and removes the next job in the queue.\r
         /// </summary>\r
@@ -93,7 +94,14 @@ namespace Handbrake.EncodeQueue
         /// </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
@@ -162,7 +170,8 @@ namespace Handbrake.EncodeQueue
         /// <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
@@ -170,7 +179,7 @@ namespace Handbrake.EncodeQueue
                 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
@@ -212,13 +221,15 @@ namespace Handbrake.EncodeQueue
                         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
@@ -228,7 +239,8 @@ namespace Handbrake.EncodeQueue
         /// <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
@@ -238,7 +250,7 @@ namespace Handbrake.EncodeQueue
                     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
@@ -348,7 +360,8 @@ namespace Handbrake.EncodeQueue
 \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