Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- DocumentCollection.cs
- TraceLog.cs
- CredentialManagerDialog.cs
- XamlHostingSectionGroup.cs
- DecimalConverter.cs
- ShellProvider.cs
- GPPOINT.cs
- Process.cs
- WebResourceAttribute.cs
- AssemblyUtil.cs
- ObjectTokenCategory.cs
- SqlUserDefinedAggregateAttribute.cs
- FieldAccessException.cs
- EventRoute.cs
- BrowserInteropHelper.cs
- EmbeddedMailObjectCollectionEditor.cs
- InputEventArgs.cs
- DictionarySectionHandler.cs
- AssemblyNameProxy.cs
- FastEncoderWindow.cs
- EditorPartChrome.cs
- Stack.cs
- ContentTextAutomationPeer.cs
- DriveNotFoundException.cs
- HexParser.cs
- ProtocolViolationException.cs
- cookiecontainer.cs
- EncodingNLS.cs
- CleanUpVirtualizedItemEventArgs.cs
- GuidelineCollection.cs
- DataGridViewTextBoxEditingControl.cs
- UIElementAutomationPeer.cs
- SqlDataSourceStatusEventArgs.cs
- NameValuePair.cs
- CodeDOMUtility.cs
- DataGridViewIntLinkedList.cs
- Message.cs
- PropertyCollection.cs
- ApplicationGesture.cs
- ProtectedProviderSettings.cs
- ISO2022Encoding.cs
- TileBrush.cs
- HttpCapabilitiesBase.cs
- ServiceThrottlingElement.cs
- Control.cs
- ToolStripPanelRow.cs
- TextServicesDisplayAttribute.cs
- PageWrapper.cs
- BinaryQueryOperator.cs
- HttpCacheVary.cs
- XmlAnyElementAttributes.cs
- BamlWriter.cs
- ContextStack.cs
- DecoderReplacementFallback.cs
- dataprotectionpermissionattribute.cs
- User.cs
- SimpleRecyclingCache.cs
- DSASignatureDeformatter.cs
- HttpConfigurationSystem.cs
- NamespaceDecl.cs
- PageClientProxyGenerator.cs
- UriTemplateEquivalenceComparer.cs
- QueryContinueDragEvent.cs
- CompatibleComparer.cs
- InvalidDataException.cs
- EntityDataSourceEntitySetNameItem.cs
- FastEncoderWindow.cs
- DataServiceContext.cs
- SqlWorkflowInstanceStore.cs
- SqlXmlStorage.cs
- XmlIterators.cs
- CngUIPolicy.cs
- SQLByte.cs
- ReadContentAsBinaryHelper.cs
- TableRow.cs
- LoginUtil.cs
- ListContractAdapter.cs
- TransformDescriptor.cs
- XmlSchemaChoice.cs
- IntegerValidatorAttribute.cs
- DayRenderEvent.cs
- UseLicense.cs
- BindingExpression.cs
- TemplateField.cs
- CounterSampleCalculator.cs
- WebSysDisplayNameAttribute.cs
- ProbeRequestResponseAsyncResult.cs
- OraclePermission.cs
- SqlCaseSimplifier.cs
- x509store.cs
- DataGridViewToolTip.cs
- ProtocolsConfigurationEntry.cs
- XmlSchemaSimpleTypeRestriction.cs
- AppSettingsExpressionBuilder.cs
- FirstMatchCodeGroup.cs
- EnvironmentPermission.cs
- Util.cs
- AggregateException.cs
- RemoteDebugger.cs
- RouteUrlExpressionBuilder.cs