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
- DigitShape.cs
- MarkupProperty.cs
- WebPartConnectionsEventArgs.cs
- HitTestWithGeometryDrawingContextWalker.cs
- ServiceOperationViewControl.cs
- ObjectContextServiceProvider.cs
- WebPartVerbsEventArgs.cs
- SocketAddress.cs
- TypeSystem.cs
- TextProperties.cs
- DBSqlParser.cs
- ServiceManager.cs
- DeclarativeCatalogPartDesigner.cs
- ServiceHostingEnvironment.cs
- BamlStream.cs
- AttributeXamlType.cs
- _SecureChannel.cs
- TrackingProfileManager.cs
- MiniModule.cs
- Stylus.cs
- StreamingContext.cs
- ReadOnlyTernaryTree.cs
- Geometry3D.cs
- RequestResponse.cs
- CollectionBase.cs
- _ScatterGatherBuffers.cs
- XmlSchemaValidator.cs
- SecureStringHasher.cs
- OrthographicCamera.cs
- ObjectMemberMapping.cs
- MetadataWorkspace.cs
- FileDataSourceCache.cs
- Utils.cs
- PictureBox.cs
- HandleCollector.cs
- DataGridAutoFormatDialog.cs
- CodeDOMUtility.cs
- MenuItem.cs
- NegationPusher.cs
- SqlGenericUtil.cs
- Variant.cs
- WebPartConnectVerb.cs
- TileBrush.cs
- DataObjectEventArgs.cs
- DTCTransactionManager.cs
- InputLanguage.cs
- TemplateModeChangedEventArgs.cs
- EventDescriptor.cs
- CharacterShapingProperties.cs
- ComponentEvent.cs
- CompilerErrorCollection.cs
- WebPartConnectionsCancelVerb.cs
- ResourceContainer.cs
- SelectionHighlightInfo.cs
- PeerContact.cs
- TriState.cs
- PropertyChangedEventManager.cs
- DataBindingExpressionBuilder.cs
- Int32CAMarshaler.cs
- DiscardableAttribute.cs
- ReadWriteControlDesigner.cs
- StandardRuntimeEnumValidator.cs
- FormClosingEvent.cs
- InfoCardClaim.cs
- XmlTypeMapping.cs
- DataGridColumn.cs
- SqlConnectionPoolGroupProviderInfo.cs
- PropertyMapper.cs
- SQLGuidStorage.cs
- SocketCache.cs
- ServiceHostFactory.cs
- XmlAtomicValue.cs
- DbProviderConfigurationHandler.cs
- LinearKeyFrames.cs
- XsltArgumentList.cs
- Hash.cs
- CryptoApi.cs
- Substitution.cs
- VisualProxy.cs
- FormView.cs
- BamlStream.cs
- NavigationProgressEventArgs.cs
- DataGridViewRowStateChangedEventArgs.cs
- SystemIPv6InterfaceProperties.cs
- DirectoryObjectSecurity.cs
- GeometryHitTestParameters.cs
- FormatSelectingMessageInspector.cs
- Misc.cs
- EventLogTraceListener.cs
- Speller.cs
- ClientConfigPaths.cs
- ClientConfigPaths.cs
- ServicesUtilities.cs
- SmiRecordBuffer.cs
- FontUnitConverter.cs
- DataControlFieldCell.cs
- Scripts.cs
- Vector3DAnimation.cs
- AsyncStreamReader.cs
- HtmlInputControl.cs