ImageList il = new ImageList ();
// test its defaults
-#if NET_2_0
Assert.IsTrue (colordepth_prop.ShouldSerializeValue (il), "1");
Assert.IsTrue (colordepth_prop.CanResetValue (il), "2");
Assert.IsTrue (imagesize_prop.ShouldSerializeValue (il), "3");
il.ImageSize = new Size (32, 32);
Assert.IsFalse (imagesize_prop.ShouldSerializeValue (il), "23");
Assert.IsFalse (imagesize_prop.CanResetValue (il), "24");
-#else
-
- Assert.IsFalse (colordepth_prop.ShouldSerializeValue (il), "1");
- Assert.IsFalse (colordepth_prop.CanResetValue (il), "2");
- Assert.IsFalse (imagesize_prop.ShouldSerializeValue (il), "3");
- Assert.IsFalse (imagesize_prop.CanResetValue (il), "4");
- Assert.IsTrue (transparentcolor_prop.ShouldSerializeValue (il), "5");
- Assert.IsFalse (transparentcolor_prop.CanResetValue (il), "6");
-
- // test what happens when we set the transparent color to LightGray
- il.TransparentColor = Color.LightGray;
- Assert.IsFalse (transparentcolor_prop.ShouldSerializeValue (il), "7");
- Assert.IsFalse (transparentcolor_prop.CanResetValue (il), "8");
-
- // test what happens when we set the depth to something other than the default
- il.ColorDepth = ColorDepth.Depth16Bit;
- Assert.IsTrue (colordepth_prop.ShouldSerializeValue (il), "9");
- Assert.IsTrue (colordepth_prop.CanResetValue (il), "10");
-
- // same test for ImageSize
- il.ImageSize = new Size (32, 32);
- Assert.IsTrue (imagesize_prop.ShouldSerializeValue (il), "11");
- Assert.IsFalse (imagesize_prop.CanResetValue (il), "12");
-
- // create an ImageList containing an image
- il = new ImageList ();
- il.Images.Add (Image.FromFile ("M.gif"));
-
- Assert.IsFalse (colordepth_prop.ShouldSerializeValue (il), "13");
- Assert.IsFalse (colordepth_prop.CanResetValue (il), "14");
- Assert.IsFalse (imagesize_prop.ShouldSerializeValue (il), "15");
- Assert.IsFalse (imagesize_prop.CanResetValue (il), "16");
- Assert.IsTrue (transparentcolor_prop.ShouldSerializeValue (il), "17");
- Assert.IsFalse (transparentcolor_prop.CanResetValue (il), "18");
-
- // test what happens when we set the transparent color to LightGray
- il.TransparentColor = Color.LightGray;
- Assert.IsFalse (transparentcolor_prop.ShouldSerializeValue (il), "19");
- Assert.IsFalse (transparentcolor_prop.CanResetValue (il), "20");
-
- // test what happens when we set the depth to something other than the default
- il.ColorDepth = ColorDepth.Depth16Bit;
- Assert.IsTrue (colordepth_prop.ShouldSerializeValue (il), "21");
- Assert.IsTrue (colordepth_prop.CanResetValue (il), "22");
-
- // same test for ImageSize
- il.ImageSize = new Size (32, 32);
- Assert.IsTrue (imagesize_prop.ShouldSerializeValue (il), "23");
- Assert.IsFalse (imagesize_prop.CanResetValue (il), "24");
-#endif
}
[Test]