Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / CommonUI / System / Drawing / BufferedGraphicsManager.cs / 1 / BufferedGraphicsManager.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Drawing { using System; using System.ComponentModel; using System.Collections; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Text; using System.Diagnostics; using System.Runtime.InteropServices; using System.Threading; using System.Security; using System.Security.Permissions; using System.Runtime.ConstrainedExecution; ////// /// The BufferedGraphicsManager is used for accessing a BufferedGraphicsContext. /// public sealed class BufferedGraphicsManager { private static BufferedGraphicsContext bufferedGraphicsContext; ////// /// Private constructor. /// private BufferedGraphicsManager() { } ////// /// Static constructor. Here, we hook the exit & unload events so we can clean up our context buffer. /// static BufferedGraphicsManager() { AppDomain.CurrentDomain.ProcessExit += new EventHandler(BufferedGraphicsManager.OnShutdown); AppDomain.CurrentDomain.DomainUnload += new EventHandler(BufferedGraphicsManager.OnShutdown); bufferedGraphicsContext = new BufferedGraphicsContext(); } ////// /// Retrieves the context associated with the app domain. /// public static BufferedGraphicsContext Current { get { return bufferedGraphicsContext; } } ////// /// Called on process exit /// [PrePrepareMethod] private static void OnShutdown(object sender, EventArgs e) { BufferedGraphicsManager.Current.Invalidate(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Drawing { using System; using System.ComponentModel; using System.Collections; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Text; using System.Diagnostics; using System.Runtime.InteropServices; using System.Threading; using System.Security; using System.Security.Permissions; using System.Runtime.ConstrainedExecution; ////// /// The BufferedGraphicsManager is used for accessing a BufferedGraphicsContext. /// public sealed class BufferedGraphicsManager { private static BufferedGraphicsContext bufferedGraphicsContext; ////// /// Private constructor. /// private BufferedGraphicsManager() { } ////// /// Static constructor. Here, we hook the exit & unload events so we can clean up our context buffer. /// static BufferedGraphicsManager() { AppDomain.CurrentDomain.ProcessExit += new EventHandler(BufferedGraphicsManager.OnShutdown); AppDomain.CurrentDomain.DomainUnload += new EventHandler(BufferedGraphicsManager.OnShutdown); bufferedGraphicsContext = new BufferedGraphicsContext(); } ////// /// Retrieves the context associated with the app domain. /// public static BufferedGraphicsContext Current { get { return bufferedGraphicsContext; } } ////// /// Called on process exit /// [PrePrepareMethod] private static void OnShutdown(object sender, EventArgs e) { BufferedGraphicsManager.Current.Invalidate(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ShaderRenderModeValidation.cs
- ComponentEditorPage.cs
- ExpressionVisitor.cs
- ErrorFormatterPage.cs
- DescendantQuery.cs
- CreateRefExpr.cs
- DomainConstraint.cs
- GC.cs
- XmlSchemas.cs
- DateTimeFormatInfoScanner.cs
- DataGridComboBoxColumn.cs
- XmlTextAttribute.cs
- Visual3D.cs
- TimersDescriptionAttribute.cs
- EndpointReference.cs
- StorageMappingItemCollection.cs
- CreateUserErrorEventArgs.cs
- XmlCustomFormatter.cs
- PlatformCulture.cs
- Localizer.cs
- BitmapEffectDrawing.cs
- WhereaboutsReader.cs
- SystemFonts.cs
- DropShadowBitmapEffect.cs
- XmlTypeAttribute.cs
- ComProxy.cs
- ScaleTransform.cs
- AtomMaterializerLog.cs
- PageContentAsyncResult.cs
- PropertyChangingEventArgs.cs
- Message.cs
- HttpFormatExtensions.cs
- HttpProfileBase.cs
- FileDetails.cs
- ToolStripCustomTypeDescriptor.cs
- SqlDataSourceCommandEventArgs.cs
- BypassElementCollection.cs
- MaskedTextBox.cs
- RectValueSerializer.cs
- HashAlgorithm.cs
- Oid.cs
- ComponentResourceKey.cs
- ListViewDataItem.cs
- PoisonMessageException.cs
- ScrollBarRenderer.cs
- PrimitiveList.cs
- OpenTypeLayoutCache.cs
- FrameworkName.cs
- MetafileEditor.cs
- SolidBrush.cs
- ProgressBarRenderer.cs
- CheckBoxStandardAdapter.cs
- StrokeCollectionDefaultValueFactory.cs
- PersonalizableAttribute.cs
- InvalidPropValue.cs
- SerializationHelper.cs
- DataGridTextBox.cs
- Size.cs
- SvcMapFileLoader.cs
- UDPClient.cs
- CursorConverter.cs
- BatchParser.cs
- SID.cs
- SspiSecurityTokenParameters.cs
- ObjectItemConventionAssemblyLoader.cs
- CodeTypeReferenceCollection.cs
- AuthenticationManager.cs
- Subordinate.cs
- NavigationProperty.cs
- BrowserInteropHelper.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- TabControlEvent.cs
- DrawToolTipEventArgs.cs
- regiisutil.cs
- WebControlsSection.cs
- TagPrefixInfo.cs
- PlanCompilerUtil.cs
- InputLanguageProfileNotifySink.cs
- FamilyCollection.cs
- BoundColumn.cs
- FixedPosition.cs
- PersistenceException.cs
- SrgsGrammar.cs
- ParameterElementCollection.cs
- Expressions.cs
- ValidatingPropertiesEventArgs.cs
- CodeIndexerExpression.cs
- XPathNodeInfoAtom.cs
- XmlArrayItemAttributes.cs
- WhitespaceSignificantCollectionAttribute.cs
- GeometryCollection.cs
- SrgsDocumentParser.cs
- BaseParagraph.cs
- FrugalList.cs
- InvalidateEvent.cs
- ToolStripPanelCell.cs
- DataList.cs
- FixedTextBuilder.cs
- TableItemStyle.cs
- BufferedStream.cs