OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 24 Jan 2010 17:39:17 +0000 (17:39 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 24 Jan 2010 17:39:17 +0000 (17:39 +0000)
- Quick patch to allow "," to be used in CSV files when importing into the gui.

git-svn-id: svn://localhost/HandBrake/trunk@3085 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/Functions/Main.cs
win/C#/Functions/QueryGenerator.cs
win/C#/Functions/UpdateCheckInformation.cs

index e9c4442..8c92d76 100644 (file)
@@ -97,10 +97,11 @@ namespace Handbrake.Functions
                 {\r
                     if (csv.Trim() != "")\r
                     {\r
+                        csv = csv.Replace("\\,", "<!comma!>");\r
                         string[] contents = csv.Split(',');\r
                         int chapter;\r
                         int.TryParse(contents[0], out chapter);\r
-                        chapterMap.Add(chapter, contents[1]);\r
+                        chapterMap.Add(chapter, contents[1].Replace("<!comma!>", ","));\r
                     }\r
                     csv = sr.ReadLine();\r
                 }\r
@@ -436,32 +437,6 @@ namespace Handbrake.Functions
         }\r
 \r
         /// <summary>\r
-        /// Used in EndUpdateCheck() for update checking and the IAsyncResult design pattern.\r
-        /// </summary>\r
-        private class UpdateCheckResult : IAsyncResult\r
-        {\r
-            public UpdateCheckResult(object asyncState, UpdateCheckInformation info)\r
-            {\r
-                AsyncState = asyncState;\r
-                Result = info;\r
-            }\r
-\r
-            /// <summary>\r
-            /// Gets whether the check was executed in debug mode.\r
-            /// </summary>\r
-            public object AsyncState { get; private set; }\r
-\r
-            /// <summary>\r
-            /// Gets the result of the update check.\r
-            /// </summary>\r
-            public UpdateCheckInformation Result { get; private set; }\r
-\r
-            public WaitHandle AsyncWaitHandle { get { throw new NotImplementedException(); } }\r
-            public bool CompletedSynchronously { get { throw new NotImplementedException(); } }\r
-            public bool IsCompleted { get { throw new NotImplementedException(); } }\r
-        }\r
-\r
-        /// <summary>\r
         /// Map languages and their iso639_2 value into a IDictionary\r
         /// </summary>\r
         /// <returns></returns>\r
@@ -658,6 +633,5 @@ namespace Handbrake.Functions
                                                           };\r
             return languageMap;\r
         }\r
-\r
     }\r
-}\r
+}
\ No newline at end of file
index 37e5b66..3c15f73 100644 (file)
@@ -590,7 +590,7 @@ namespace Handbrake.Functions
                 {\r
                     csv += row.Cells[0].Value.ToString();\r
                     csv += ",";\r
-                    csv += row.Cells[1].Value.ToString();\r
+                    csv += row.Cells[1].Value.ToString().Replace(",","\\,");\r
                     csv += Environment.NewLine;\r
                 }\r
                 StreamWriter file = new StreamWriter(filePathName);\r
index 2538178..c157f8a 100644 (file)
@@ -1,4 +1,5 @@
 using System;\r
+using System.Threading;\r
 \r
 namespace Handbrake.Functions\r
 {\r
@@ -20,4 +21,30 @@ namespace Handbrake.Functions
         /// </summary>\r
         public Exception Error { get; set; }\r
     }\r
+\r
+    /// <summary>\r
+    /// Used in EndUpdateCheck() for update checking and the IAsyncResult design pattern.\r
+    /// </summary>\r
+    public class UpdateCheckResult : IAsyncResult\r
+    {\r
+        public UpdateCheckResult(object asyncState, UpdateCheckInformation info)\r
+        {\r
+            AsyncState = asyncState;\r
+            Result = info;\r
+        }\r
+\r
+        /// <summary>\r
+        /// Gets whether the check was executed in debug mode.\r
+        /// </summary>\r
+        public object AsyncState { get; private set; }\r
+\r
+        /// <summary>\r
+        /// Gets the result of the update check.\r
+        /// </summary>\r
+        public UpdateCheckInformation Result { get; private set; }\r
+\r
+        public WaitHandle AsyncWaitHandle { get { throw new NotImplementedException(); } }\r
+        public bool CompletedSynchronously { get { throw new NotImplementedException(); } }\r
+        public bool IsCompleted { get { throw new NotImplementedException(); } }\r
+    }\r
 }\r