All pastes #58155 Raw Edit

Anonymous

public text v1 · immutable
#58155 ·published 2006-05-22 21:15 UTC
rendered paste body
		public class PEA : PaintEventArgs {
			public PEA (Graphics g, Rectangle clip) : base(g, clip) {
			}

			~PEA() {
				Dispose(true);
			}

			protected override void Dispose(bool disposing) {
				Console.WriteLine("Disposing PEA, {0}", disposing);
				base.Dispose (disposing);
			}

		}

		void SubPaint(PaintEventArgs e) {
			//PaintEventArgs f;
			PEA f;

			//f = new PaintEventArgs(e.Graphics, e.ClipRectangle);
			f = new PEA(e.Graphics, e.ClipRectangle);
			Console.WriteLine("e.Hash={0:X}, f.Hash={1:X}", e.Graphics.GetHashCode(), f.Graphics.GetHashCode());
		}

		protected override void OnPaint(PaintEventArgs e) {
			SubPaint(e);
			GC.Collect();
			base.OnPaint (e);
		}