OSDN Git Service

構成変更のためファイルを置き直し。
[kybernetes/Kybernetes.git] / TaskControlCommand / command / Control / DelayCommandArg.cs
diff --git a/TaskControlCommand/command/Control/DelayCommandArg.cs b/TaskControlCommand/command/Control/DelayCommandArg.cs
new file mode 100644 (file)
index 0000000..d57ddc9
--- /dev/null
@@ -0,0 +1,52 @@
+using System;\r
+using com.andoutomo.kybernetes.data;\r
+using com.andoutomo.kybernetes.command.template;\r
+\r
+namespace com.andoutomo.kybernetes.command.Control\r
+{\r
+    class DelayCommandArg:StandardCommandArg\r
+    {\r
+        public DateComponent nextDate\r
+        {\r
+            get;\r
+            private set;\r
+        }\r
+        public int DateToSkip\r
+        {\r
+            get;\r
+            private set;\r
+        }\r
+\r
+        protected override void split()\r
+        {\r
+            if (splitData.Length == 3)\r
+            {\r
+                if (splitData[2].Contains("/"))\r
+                {\r
+                    nextDate = new DateComponent(splitData[2].Replace("/", ""));\r
+                }\r
+                else if (splitData[2].Length < 4)\r
+                {\r
+                    DateToSkip = Convert.ToInt32(splitData[2]);\r
+                }\r
+                else\r
+                {\r
+                    nextDate = new DateComponent(splitData[2]);\r
+                }\r
+                \r
+                isValid = true;\r
+            }\r
+            else if (splitData.Length == 2)\r
+            {\r
+                nextDate = null;\r
+                DateToSkip = int.MinValue;\r
+                isValid = true;\r
+            }\r
+            else\r
+            {\r
+                isValid = false;\r
+            }\r
+\r
+        }\r
+    }\r
+}\r