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)); }
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); }