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
- DatatypeImplementation.cs
- ClockGroup.cs
- RootContext.cs
- UserPersonalizationStateInfo.cs
- ResourcesGenerator.cs
- Converter.cs
- XamlBrushSerializer.cs
- TextBlockAutomationPeer.cs
- DataObjectMethodAttribute.cs
- SQLStringStorage.cs
- BamlLocalizabilityResolver.cs
- XmlUrlResolver.cs
- XmlDataLoader.cs
- WindowsToolbar.cs
- EndOfStreamException.cs
- RTLAwareMessageBox.cs
- SmtpReplyReaderFactory.cs
- CodeMemberField.cs
- StructuralCache.cs
- TreeViewItem.cs
- SmiMetaDataProperty.cs
- unsafeIndexingFilterStream.cs
- InputScopeConverter.cs
- SmtpNegotiateAuthenticationModule.cs
- EventProviderWriter.cs
- MsmqIntegrationChannelListener.cs
- XmlEnumAttribute.cs
- EllipticalNodeOperations.cs
- HitTestWithPointDrawingContextWalker.cs
- DESCryptoServiceProvider.cs
- RegistrySecurity.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ConfigurationManagerHelper.cs
- HttpPostProtocolReflector.cs
- StringOutput.cs
- httpserverutility.cs
- SqlDependencyUtils.cs
- BuildProvidersCompiler.cs
- RightsManagementInformation.cs
- MethodRental.cs
- DbMetaDataCollectionNames.cs
- ByteAnimation.cs
- SerializationException.cs
- TableCell.cs
- ResXResourceReader.cs
- AspCompat.cs
- XmlSerializerFactory.cs
- TextEffectCollection.cs
- WindowsGrip.cs
- XmlUtil.cs
- InnerItemCollectionView.cs
- PackWebRequestFactory.cs
- GridViewSelectEventArgs.cs
- IDQuery.cs
- Baml2006ReaderContext.cs
- FormatterServices.cs
- ErrorStyle.cs
- SoapExtension.cs
- TypeHelper.cs
- WebPartDeleteVerb.cs
- TransformGroup.cs
- DiscoveryOperationContextExtension.cs
- ApplicationDirectory.cs
- SerializationSectionGroup.cs
- DataGridrowEditEndingEventArgs.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- WebConvert.cs
- InputEventArgs.cs
- ExtensionWindowResizeGrip.cs
- DataRowChangeEvent.cs
- SystemEvents.cs
- Thread.cs
- ReturnEventArgs.cs
- IgnoreFlushAndCloseStream.cs
- SQLBoolean.cs
- MimePart.cs
- CreateUserErrorEventArgs.cs
- TextEditor.cs
- Int64AnimationUsingKeyFrames.cs
- UTF8Encoding.cs
- DesignBindingPicker.cs
- DoubleUtil.cs
- PropertyReferenceSerializer.cs
- Matrix.cs
- WorkflowRuntimeEndpoint.cs
- PropertyEntry.cs
- typedescriptorpermissionattribute.cs
- ElementFactory.cs
- TraceHandlerErrorFormatter.cs
- HttpHandler.cs
- XmlNodeWriter.cs
- Item.cs
- AuthenticatingEventArgs.cs
- RegionIterator.cs
- LineMetrics.cs
- NGCSerializer.cs
- StringFormat.cs
- ResourceLoader.cs
- COM2Properties.cs
- HealthMonitoringSection.cs