Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CommonUI / System / Drawing / BufferedGraphicsManager.cs / 1305376 / 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
- DataGridColumnHeaderCollection.cs
- SqlLiftWhereClauses.cs
- ProgressPage.cs
- OutputCacheSettings.cs
- ContextTokenTypeConverter.cs
- SecurityUniqueId.cs
- FormsAuthenticationTicket.cs
- ErrorProvider.cs
- XmlHierarchyData.cs
- WebPart.cs
- ComAdminWrapper.cs
- Proxy.cs
- SendActivityDesignerTheme.cs
- Socket.cs
- CoreSwitches.cs
- Wildcard.cs
- SchemaTableColumn.cs
- OleDbRowUpdatingEvent.cs
- Registry.cs
- ConditionalAttribute.cs
- WindowsImpersonationContext.cs
- ThicknessAnimationBase.cs
- Base64Encoder.cs
- KeyFrames.cs
- WindowsGraphicsCacheManager.cs
- Pen.cs
- ZipIORawDataFileBlock.cs
- ValueSerializer.cs
- ProfileSettings.cs
- TextEffectResolver.cs
- UnaryNode.cs
- OutKeywords.cs
- ECDsa.cs
- GenericPrincipal.cs
- IUnknownConstantAttribute.cs
- SolidBrush.cs
- COM2IProvidePropertyBuilderHandler.cs
- AuthenticationModuleElement.cs
- ConstructorExpr.cs
- WindowsFormsHelpers.cs
- ArrangedElement.cs
- TypeUtil.cs
- Stylesheet.cs
- SelectionProviderWrapper.cs
- TabletDeviceInfo.cs
- ExpandedWrapper.cs
- SubclassTypeValidator.cs
- BrowserDefinition.cs
- HttpCachePolicyElement.cs
- Padding.cs
- XmlNavigatorStack.cs
- XmlWellformedWriter.cs
- PaintValueEventArgs.cs
- XmlSchemaAttributeGroup.cs
- UriSectionReader.cs
- EdmSchemaError.cs
- DynamicContractTypeBuilder.cs
- TextRunProperties.cs
- DependencyObjectType.cs
- SafePointer.cs
- UInt64.cs
- SystemDropShadowChrome.cs
- JournalEntry.cs
- CodeCompiler.cs
- SystemKeyConverter.cs
- _ServiceNameStore.cs
- UInt16Converter.cs
- OracleFactory.cs
- BindingExpression.cs
- TouchesCapturedWithinProperty.cs
- GeneralTransform3D.cs
- SqlBinder.cs
- ObjectSet.cs
- OleDbReferenceCollection.cs
- XsdDateTime.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- ExecutionContext.cs
- Viewport2DVisual3D.cs
- WindowsTab.cs
- RangeValidator.cs
- SymbolUsageManager.cs
- QuaternionAnimationBase.cs
- XPathArrayIterator.cs
- SettingsAttributes.cs
- UIPermission.cs
- Timer.cs
- HopperCache.cs
- CodeDirectiveCollection.cs
- NameValueConfigurationCollection.cs
- TimeSpanFormat.cs
- BoundPropertyEntry.cs
- CryptoApi.cs
- GetIndexBinder.cs
- QueryGenerator.cs
- CfgParser.cs
- XmlSchemaCompilationSettings.cs
- HtmlCalendarAdapter.cs
- MaskedTextBoxTextEditor.cs
- GlobalizationAssembly.cs
- CqlLexerHelpers.cs