OSDN Git Service

構成変更のためファイルを置き直し。
[kybernetes/Kybernetes.git] / TaskControlCommand / command / Control / RepeatCommandArg.cs
diff --git a/TaskControlCommand/command/Control/RepeatCommandArg.cs b/TaskControlCommand/command/Control/RepeatCommandArg.cs
new file mode 100644 (file)
index 0000000..4bfdbfb
--- /dev/null
@@ -0,0 +1,42 @@
+using com.andoutomo.kybernetes.command.template;\r
+\r
+namespace com.andoutomo.kybernetes.command\r
+{\r
+    class RepeatCommandArg:StandardCommandArg\r
+    {\r
+        public bool isRepeat\r
+        {\r
+            get;\r
+            private set;\r
+        }\r
+        protected override void split()\r
+        {\r
+            if (splitData.Length < 3)\r
+            {\r
+                isValid = false;\r
+                return;\r
+            }\r
+            string word = splitData[2];\r
+            switch (word.ToLower())\r
+            {\r
+                case "on":\r
+                case "true":\r
+                case "1":\r
+                    isRepeat = true;\r
+                    isValid = true;\r
+                    break;\r
+                \r
+                case "off":\r
+                case "false":\r
+                case "0":\r
+                    isRepeat = false;\r
+                    isValid = true;\r
+                    break;\r
+\r
+                default:\r
+                    isValid = false;\r
+                    break;\r
+            }\r
+        }\r
+    }\r
+}\r