Пример #1
0
        public int Build(SongOption songOption)
        {
            AllowCORS();

            lastID++;
            BuilderTask task = new BuilderTask()
            {
                ID = lastID, FilePath = FilePath
            };

            task.Build(songOption);
            taskList.Add(task);
            return(task.ID);
        }
Пример #2
0
        public double State(String idStr)
        {
            AllowCORS();

            int id = 0;

            int.TryParse(idStr, out id);
            if (id == 0)
            {
                return(0);
            }
            BuilderTask task = taskList.FirstOrDefault(entry => entry.ID == id);

            if (task == null)
            {
                return(0);
            }
            return(task.GetProgressState());
        }