Exemple #1
0
        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);
                }
            }
        }
Exemple #2
0
        ///  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);
        }