Esempio n. 1
0
        public override bool Equals(object other)
        {
            if (other == null || !(other is PartitionMask))
            {
                return(false);
            }

            PartitionMask o = (PartitionMask)other;

            return(o.BitCount.Equals(this.BitCount) && o.Value.Equals(this.Value));
        }
Esempio n. 2
0
        public static PartitionMask[] BuildSet(byte bitCount)
        {
            int count = 1 << bitCount;

            PartitionMask[] set = new PartitionMask[count];

            for (int i = 0; i < count; ++i)
            {
                set[i] = new PartitionMask((i << (32 - bitCount)), bitCount);
            }

            return(set);
        }