示例#1
0
        public static void Main()
        {
            var bitsArray = new BitArray64(128);

            Console.WriteLine("Bits: {0}", bitsArray);
            Console.WriteLine("Value: {0}\n", bitsArray.Value);

            // change index in array
            bitsArray[30] = 1;
            Console.WriteLine("Bits: {0}", bitsArray);
            Console.WriteLine("Value: {0}\n", bitsArray.Value);

            Console.Write("Bits: ");
            var maxArray = new BitArray64(ulong.MaxValue);

            foreach (var bit in maxArray)
            {
                Console.Write(bit);
            }

            Console.WriteLine();
            Console.WriteLine("Value: {0}\n", maxArray.Value);

            var newArray = new BitArray64(32);

            Console.WriteLine(bitsArray.Equals(newArray));
            Console.WriteLine(newArray != bitsArray);
        }
示例#2
0
        public override bool Equals(object obj)
        {
            BitArray64 other = obj as BitArray64;

            if (other == null)
            {
                return(false);
            }

            return(this.number == other.number);
        }
示例#3
0
        public override bool Equals(object obj)
        {
            var arrayAsObj = obj as BitArray64;

            if ((object)arrayAsObj == null)
            {
                return(false);
            }

            return(BitArray64.Equals(this.value, arrayAsObj.value));
        }
示例#4
0
 public static bool operator !=(BitArray64 first, BitArray64 second)
 {
     return(!BitArray64.Equals(first, second));
 }