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
- prompt.cs
- SaveFileDialog.cs
- DbTypeMap.cs
- UInt16.cs
- EnumDataContract.cs
- DataSourceControlBuilder.cs
- BinaryExpression.cs
- SqlConnectionString.cs
- StructuralCache.cs
- EventEntry.cs
- XmlSchemaObject.cs
- SubclassTypeValidatorAttribute.cs
- SiteMapDataSourceView.cs
- GlobalProxySelection.cs
- ToolboxControl.cs
- StateManagedCollection.cs
- WSDualHttpSecurityMode.cs
- HttpsHostedTransportConfiguration.cs
- EnumMemberAttribute.cs
- EventRoute.cs
- XmlSchemaExporter.cs
- Formatter.cs
- ActivationServices.cs
- EtwProvider.cs
- ItemsChangedEventArgs.cs
- LogEntrySerialization.cs
- AttributeTableBuilder.cs
- IndividualDeviceConfig.cs
- SqlGenerator.cs
- SqlBuilder.cs
- OracleConnectionStringBuilder.cs
- CellPartitioner.cs
- XmlEntityReference.cs
- ThreadAbortException.cs
- StateRuntime.cs
- TextDecorationLocationValidation.cs
- ProfilePropertySettingsCollection.cs
- WindowsPrincipal.cs
- XmlSchemaResource.cs
- EnvelopedPkcs7.cs
- ClientScriptManagerWrapper.cs
- TextTrailingCharacterEllipsis.cs
- InternalConfigHost.cs
- ColorTranslator.cs
- BinaryNode.cs
- FormView.cs
- HttpDebugHandler.cs
- InternalControlCollection.cs
- CompressStream.cs
- VirtualPathProvider.cs
- DataGridViewCheckBoxColumn.cs
- TextViewSelectionProcessor.cs
- Rect3DValueSerializer.cs
- StdRegProviderWrapper.cs
- FtpRequestCacheValidator.cs
- ParseNumbers.cs
- ContentFilePart.cs
- SendMailErrorEventArgs.cs
- ILGenerator.cs
- ConfigurationStrings.cs
- DataObjectPastingEventArgs.cs
- PassportAuthenticationModule.cs
- SqlWebEventProvider.cs
- WebPartCatalogAddVerb.cs
- PropertyConverter.cs
- StringAnimationBase.cs
- Image.cs
- OutArgument.cs
- ReferencedType.cs
- MenuItemBindingCollection.cs
- TextBlockAutomationPeer.cs
- Point3DCollectionValueSerializer.cs
- ComponentResourceKeyConverter.cs
- AstTree.cs
- COAUTHINFO.cs
- Int64Storage.cs
- SystemIcmpV4Statistics.cs
- RouteItem.cs
- ConfigUtil.cs
- EncodingNLS.cs
- WebServiceHost.cs
- WindowPattern.cs
- ZipPackagePart.cs
- OrderingInfo.cs
- BamlTreeNode.cs
- DropSource.cs
- ConfigUtil.cs
- OdbcTransaction.cs
- BitmapEffectrendercontext.cs
- InputReferenceExpression.cs
- WindowsSolidBrush.cs
- MetadataPropertyvalue.cs
- GetFileNameResult.cs
- BigIntegerStorage.cs
- XmlObjectSerializer.cs
- FileLevelControlBuilderAttribute.cs
- CalendarButton.cs
- ToolStripContentPanelDesigner.cs
- FrameAutomationPeer.cs
- IdnMapping.cs