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
- ExtractCollection.cs
- DesignerGeometryHelper.cs
- TdsParser.cs
- Types.cs
- StoreAnnotationsMap.cs
- OAVariantLib.cs
- UriSectionReader.cs
- Crypto.cs
- PenThreadWorker.cs
- ValueType.cs
- GeneralTransform3D.cs
- MultipleViewProviderWrapper.cs
- PeerEndPoint.cs
- TagPrefixInfo.cs
- NavigatorInput.cs
- QueryInterceptorAttribute.cs
- SqlServer2KCompatibilityCheck.cs
- DataGridItemCollection.cs
- WindowsProgressbar.cs
- FormViewDeleteEventArgs.cs
- MessageParameterAttribute.cs
- LinkTarget.cs
- LocatorBase.cs
- SafeLocalMemHandle.cs
- InputScope.cs
- XsdValidatingReader.cs
- Assert.cs
- MatrixValueSerializer.cs
- WebPartVerb.cs
- ConfigurationLocation.cs
- BufferedGraphicsContext.cs
- ObjectViewListener.cs
- Int32CollectionConverter.cs
- DesignerTransactionCloseEvent.cs
- AppDomainResourcePerfCounters.cs
- PointCollection.cs
- CompilationPass2Task.cs
- Bezier.cs
- Membership.cs
- GenerateScriptTypeAttribute.cs
- BookmarkWorkItem.cs
- ConstantCheck.cs
- DataGridViewRowConverter.cs
- DataRow.cs
- WSHttpSecurity.cs
- Formatter.cs
- WebZone.cs
- MessageBox.cs
- FixedTextPointer.cs
- RelatedEnd.cs
- CredentialManagerDialog.cs
- InvokeBinder.cs
- NativeWindow.cs
- FileRecordSequenceCompletedAsyncResult.cs
- InputScopeConverter.cs
- CultureTable.cs
- ButtonBaseAutomationPeer.cs
- ExtensionElement.cs
- Buffer.cs
- WebCategoryAttribute.cs
- HitTestWithPointDrawingContextWalker.cs
- SafeProcessHandle.cs
- DataGridColumnCollection.cs
- TypeDescriptionProvider.cs
- RSAPKCS1KeyExchangeFormatter.cs
- ParallelEnumerable.cs
- DataIdProcessor.cs
- CodeAccessPermission.cs
- PatternMatcher.cs
- XmlEntity.cs
- BmpBitmapDecoder.cs
- StringUtil.cs
- DesignSurfaceCollection.cs
- BlurBitmapEffect.cs
- BitmapMetadataBlob.cs
- SafeEventHandle.cs
- WriteTimeStream.cs
- CodeDOMProvider.cs
- PreDigestedSignedInfo.cs
- sqlser.cs
- XmlSchemaIdentityConstraint.cs
- SetStoryboardSpeedRatio.cs
- cookiecollection.cs
- RelatedView.cs
- InternalConfigSettingsFactory.cs
- FileLevelControlBuilderAttribute.cs
- ToolStripEditorManager.cs
- SoapAttributeOverrides.cs
- NavigateEvent.cs
- WindowsGraphics.cs
- ViewGenerator.cs
- ServiceModelEnumValidator.cs
- LambdaCompiler.Lambda.cs
- RolePrincipal.cs
- RuntimeArgument.cs
- __Error.cs
- UnaryNode.cs
- SystemThemeKey.cs
- SingleQueryOperator.cs
- ToolboxComponentsCreatingEventArgs.cs