2 writes to dc
System.Drawing (2)
commonui\System\Drawing\Printing\DefaultPrintController.cs (2)
60dc = document.PrinterSettings.CreateDeviceContext(modeHandle); 197dc = null;
28 references to dc
System.Drawing (28)
commonui\System\Drawing\Printing\DefaultPrintController.cs (28)
50Debug.Assert(dc == null && graphics == null, "PrintController methods called in the wrong order?"); 70int result = SafeNativeMethods.StartDoc(new HandleRef(this.dc, dc.Hdc), info); 91Debug.Assert(dc != null && graphics == null, "PrintController methods called in the wrong order?"); 104IntPtr result = SafeNativeMethods.ResetDC(new HandleRef(this.dc, dc.Hdc), new HandleRef(null, modePointer)); 105Debug.Assert(result == dc.Hdc, "ResetDC didn't return the same handle I gave it"); 118graphics = Graphics.FromHdcInternal( dc.Hdc ); 125int dpiX = UnsafeNativeMethods.GetDeviceCaps(new HandleRef(this.dc, dc.Hdc), SafeNativeMethods.LOGPIXELSX); 126int dpiY = UnsafeNativeMethods.GetDeviceCaps(new HandleRef(this.dc, dc.Hdc), SafeNativeMethods.LOGPIXELSY); 127int hardMarginX_DU = UnsafeNativeMethods.GetDeviceCaps(new HandleRef(this.dc, dc.Hdc), SafeNativeMethods.PHYSICALOFFSETX); 128int hardMarginY_DU = UnsafeNativeMethods.GetDeviceCaps(new HandleRef(this.dc, dc.Hdc), SafeNativeMethods.PHYSICALOFFSETY); 137int result2 = SafeNativeMethods.StartPage(new HandleRef(this.dc, dc.Hdc)); 152Debug.Assert(dc != null && graphics != null, "PrintController methods called in the wrong order?"); 160int result = SafeNativeMethods.EndPage(new HandleRef(this.dc, dc.Hdc)); 181Debug.Assert(dc != null && graphics == null, "PrintController methods called in the wrong order?"); 189if (dc != null) { 191int result = (e.Cancel) ? SafeNativeMethods.AbortDoc(new HandleRef(dc, dc.Hdc)) : SafeNativeMethods.EndDoc(new HandleRef(dc, dc.Hdc)); 196dc.Dispose();