예제 #1
0
        public int CompareTo(object obj)
        {
            ACL acl = (ACL)obj;

            if (acl == null)
            {
                throw new InvalidOperationException("Comparing different types of records.");
            }
            int num = 0;

            num = (this.Perms == acl.Perms) ? 0 : ((this.Perms < acl.Perms) ? -1 : 1);
            if (num == 0)
            {
                num = this.Id.CompareTo(acl.Id);
                if (num != 0)
                {
                    return(num);
                }
            }
            return(num);
        }
예제 #2
0
파일: ACL.cs 프로젝트: zszqwe/CommonX
        public int CompareTo(object obj)
        {
            ACL peer = (ACL)obj;

            if (peer == null)
            {
                throw new InvalidOperationException("Comparing different types of records.");
            }
            int ret = 0;

            ret = (Perms == peer.Perms)? 0 :((Perms < peer.Perms)?-1:1);
            if (ret != 0)
            {
                return(ret);
            }
            ret = Id.CompareTo(peer.Id);
            if (ret != 0)
            {
                return(ret);
            }
            return(ret);
        }
예제 #3
0
        public int CompareTo(object obj)
        {
            ACL acl = (ACL)obj;

            if (acl == null)
            {
                throw new InvalidOperationException("Comparing different types of records.");
            }
            int num1 = this.Perms == acl.Perms ? 0 : (this.Perms < acl.Perms ? -1 : 1);

            if (num1 != 0)
            {
                return(num1);
            }
            int num2 = this.Id.CompareTo((object)acl.Id);

            if (num2 != 0)
            {
                return(num2);
            }
            return(num2);
        }