Example #1
0
        /**取得当前进度**/
        public string progress()
        {
            if (vector == null || vector.Count < 1)
            {
                return(string.Empty);
            }
            TaskCondition item = vector[0];

            return(item.count > 0 ? item.value + "/" + item.count : string.Empty);
        }
Example #2
0
        /**拆分任务目标**/
        private void parserTarget(String target)
        {
            if (StringUtils.isEmpty(target) || target.Length <= 2)
            {
                return;
            }
            target = target.Substring(1, target.Length - 2);     //去掉 ‘[]’括号
            //Log.info(this,"target:"+target);

            int           index = 0;
            TaskCondition vo;

            while (target.Length > 0)
            {
                index = target.IndexOf("}");
                if (index == -1)
                {
                    break;
                }
                vo     = new TaskCondition(target.Substring(0, index + 1));
                target = target.Substring(target.Length >= index + 2 ? index + 2 : index + 1);
                vector.Add(vo);
            }
        }