internal static void ResetIfIsMeasurementDC(IntPtr hdc) { WindowsGraphics sharedGraphics = WindowsGraphicsCacheManager.GetCurrentMeasurementGraphics(); if (sharedGraphics != null && sharedGraphics.DeviceContext != null && sharedGraphics.DeviceContext.Hdc == hdc) { CachedInfo currentCachedInfo = cachedMeasurementDCInfo; if (currentCachedInfo != null) { currentCachedInfo.UpdateFont(null); } } }
/// IsMeasurementDC /// Returns whether the IDeviceContext passed in is our static MeasurementDC. /// If it is, we know a bit more information about it. internal static bool IsMeasurementDC(DeviceContext dc) { WindowsGraphics sharedGraphics = WindowsGraphicsCacheManager.GetCurrentMeasurementGraphics(); return(sharedGraphics != null && sharedGraphics.DeviceContext != null && sharedGraphics.DeviceContext.Hdc == dc.Hdc); }