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
- AutomationEvent.cs
- RegexWriter.cs
- ZipIOLocalFileDataDescriptor.cs
- UrlAuthFailureHandler.cs
- RowVisual.cs
- RegexReplacement.cs
- BitmapEncoder.cs
- XmlMtomWriter.cs
- PickDesigner.xaml.cs
- Number.cs
- TCEAdapterGenerator.cs
- TreeNodeClickEventArgs.cs
- CommandHelpers.cs
- DisplayMemberTemplateSelector.cs
- InvalidEnumArgumentException.cs
- PropertyDescriptor.cs
- ComplexPropertyEntry.cs
- HttpGetClientProtocol.cs
- SqlTypesSchemaImporter.cs
- HWStack.cs
- Pair.cs
- DeleteMemberBinder.cs
- BitmapFrameDecode.cs
- ObjectPersistData.cs
- ConfigurationValue.cs
- TemplateContent.cs
- RedBlackList.cs
- TextBoxLine.cs
- ClientRuntimeConfig.cs
- GetPageNumberCompletedEventArgs.cs
- XNodeNavigator.cs
- PrePostDescendentsWalker.cs
- InvalidWMPVersionException.cs
- EncoderExceptionFallback.cs
- CipherData.cs
- WebPartManagerInternals.cs
- PenThread.cs
- ProviderConnectionPointCollection.cs
- XmlAggregates.cs
- PipelineModuleStepContainer.cs
- SafeRegistryHandle.cs
- ThreadInterruptedException.cs
- TreeView.cs
- CheckBoxList.cs
- HttpStreamXmlDictionaryWriter.cs
- MetadataCollection.cs
- IPEndPointCollection.cs
- SqlDataSourceAdvancedOptionsForm.cs
- validationstate.cs
- InvokeBase.cs
- TemplateControlBuildProvider.cs
- XPathSingletonIterator.cs
- BinarySerializer.cs
- RunWorkerCompletedEventArgs.cs
- RefreshPropertiesAttribute.cs
- DiscoveryClientProtocol.cs
- IndexerHelper.cs
- HttpRuntime.cs
- ObjectToken.cs
- TaskHelper.cs
- Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
- MetadataArtifactLoader.cs
- VSDExceptions.cs
- RuleAction.cs
- MobileControlDesigner.cs
- PropertyBuilder.cs
- CommonObjectSecurity.cs
- AsymmetricKeyExchangeDeformatter.cs
- StickyNoteHelper.cs
- SectionVisual.cs
- TrackingRecord.cs
- TemplateBuilder.cs
- XPathNavigator.cs
- DataServiceExpressionVisitor.cs
- MDIWindowDialog.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- StyleCollection.cs
- SrgsToken.cs
- RowCache.cs
- Button.cs
- BlockExpression.cs
- SmiRequestExecutor.cs
- ADRole.cs
- SBCSCodePageEncoding.cs
- DuplexChannelBinder.cs
- UidPropertyAttribute.cs
- ClientUrlResolverWrapper.cs
- EventPrivateKey.cs
- WriteStateInfoBase.cs
- GPStream.cs
- DefaultValidator.cs
- WebScriptServiceHostFactory.cs
- Timeline.cs
- WebRequestModuleElementCollection.cs
- PathFigureCollectionValueSerializer.cs
- CollectionEditVerbManager.cs
- GlyphingCache.cs
- AgileSafeNativeMemoryHandle.cs
- WsatConfiguration.cs
- AdapterDictionary.cs