Beispiel #1
0
 /// <summary>
 /// Gets the instance.
 /// </summary>
 /// <param name="mask">The mask.</param>
 /// <returns></returns>
 public static BitField GetInstance(int mask)
 {
     BitField f = (BitField)instances[mask];
     if (f == null)
     {
         f = new BitField(mask);
         instances[mask] = f;
     }
     return f;
 }
Beispiel #2
0
 public void TestSetLargeValues()
 {
     BitField bf1 = new BitField(0xF), bf2 = new BitField(0xF0000000);
     int a = 0;
     a = bf1.SetValue(a, 9);
     a = bf2.SetValue(a, 9);
     Assert.AreEqual(9, bf1.GetValue(a));
     Assert.AreEqual(9, bf2.GetValue(a));
 }