コード例 #1
0
        public static Task CreateTask(JToken dict)
        {
            Task task = null;
            switch((string)dict["category"])
            {
            case "url":
                task = new URLTask(dict);
                break;
            case "file":
                task = new FileTask(dict);
                break;
            default:
                throw new Exception("Don't know category: " + dict["category"]);
            }

            return task;
        }
コード例 #2
0
        public static Task CreateTask(JToken dict)
        {
            Task task = null;

            switch ((string)dict["category"])
            {
            case "url":
                task = new URLTask(dict);
                break;

            case "file":
                task = new FileTask(dict);
                break;

            default:
                throw new Exception("Don't know category: " + dict["category"]);
            }

            return(task);
        }