Clone() 공개 메소드

public Clone ( ) : object
리턴 object
예제 #1
0
		public void Transparent ()
		{
			SolidBrush sb = new SolidBrush (Color.Transparent);
			Assert.AreEqual (Color.Transparent, sb.Color, "Color");
			sb.Color = Color.Empty;
			SolidBrush clone = (SolidBrush) sb.Clone ();
			sb.Dispose ();
			Assert.AreEqual (Color.Empty.ToArgb (), clone.Color.ToArgb (), "Clone.Color");
		}
예제 #2
0
		public void Dispose_Clone ()
		{
			SolidBrush sb = new SolidBrush (Color.Transparent);
			sb.Dispose ();
			sb.Clone ();
		}
예제 #3
0
		public void Clone ()
		{
			using (SolidBrush sb = new SolidBrush (Color.Transparent)) {
				// we still get a "named" color
				Assert.AreEqual (Color.Transparent, sb.Color, "Color");
				using (SolidBrush clone = (SolidBrush) sb.Clone ()) {
					// but not after cloning the brush
					Assert.IsFalse (Color.Transparent.Equals (clone.Color), "Color-Clone-Unnamed");
					Assert.AreEqual (Color.Transparent.ToArgb (), clone.Color.ToArgb (), "Color-Clone-Argb");
				}
			}
		}