Ejemplo n.º 1
0
        public override int CompareTo(ViNamedObject other)
        {
            if (other is TaskFile)
            {
                return(this.ExectionOrder - (other as TaskFile).ExectionOrder);
            }

            return(base.CompareTo(other));
        }
Ejemplo n.º 2
0
        public override int CompareTo(ViNamedObject other)
        {
            TaskFile target = other as TaskFile;

            // 如果执行顺序小于等于0,则说明该Task是随机添加上去的,在排序的时候需要放到后面;
            if (this.ExectionOrder > 0 && target.ExectionOrder > 0)
            {
                return(this.ExectionOrder - target.ExectionOrder);
            }

            return(this.ExectionOrder > 0 ? -1 : 1);
        }
Ejemplo n.º 3
0
        public override int CompareTo(ViNamedObject other)
        {
            if (this.GetType().Equals(other.GetType()))
            {
                return(this.Priority - (other as ViTaskInfo).Priority);
            }
            if (this is CyclicTaskInfo)
            {
                return(-1);
            }

            return(1);
        }
Ejemplo n.º 4
0
        public override int CompareTo(ViNamedObject other)
        {
            // 类型相同比较优先级;
            if (this.GetType().Equals(other.GetType()))
            {
                return(this.Priority - (other as ViTaskInfo).Priority);
            }
            // 类型不同,则Cycle类型的Task排到前边;
            if (this is CyclicTaskInfo)
            {
                return(-1);
            }

            return(1);
        }