Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- CancelRequestedQuery.cs
- ISAPIApplicationHost.cs
- KeyTime.cs
- Compress.cs
- DependencyObject.cs
- PassportPrincipal.cs
- XsdBuildProvider.cs
- NativeCompoundFileAPIs.cs
- DynamicPropertyReader.cs
- CheckPair.cs
- MulticastNotSupportedException.cs
- HandleRef.cs
- DataControlCommands.cs
- GroupLabel.cs
- SingleStorage.cs
- Logging.cs
- StreamInfo.cs
- BaseUriHelper.cs
- XmlSchemaSequence.cs
- TemplateBamlRecordReader.cs
- BufferedStream.cs
- NonPrimarySelectionGlyph.cs
- CmsUtils.cs
- TextBoxBase.cs
- CacheVirtualItemsEvent.cs
- ZipIOLocalFileDataDescriptor.cs
- UIElement3D.cs
- ClientSideQueueItem.cs
- HttpCapabilitiesSectionHandler.cs
- MulticastOption.cs
- AesCryptoServiceProvider.cs
- TextServicesCompartmentEventSink.cs
- ModifiableIteratorCollection.cs
- XPathItem.cs
- PeerDuplexChannel.cs
- CfgSemanticTag.cs
- RoutedEvent.cs
- MatrixConverter.cs
- EmbossBitmapEffect.cs
- XmlSerializerVersionAttribute.cs
- RemotingServices.cs
- ProxyHwnd.cs
- XPathAncestorQuery.cs
- DiscoveryClientChannelFactory.cs
- VectorKeyFrameCollection.cs
- XmlToDatasetMap.cs
- documentsequencetextview.cs
- XmlAnyAttributeAttribute.cs
- HtmlToClrEventProxy.cs
- GridProviderWrapper.cs
- ComboBoxAutomationPeer.cs
- PasswordPropertyTextAttribute.cs
- CaseExpr.cs
- DataListItemCollection.cs
- DataGridViewCellValueEventArgs.cs
- XmlSchemaAppInfo.cs
- Error.cs
- CommonDialog.cs
- StringHandle.cs
- UnsafeMethods.cs
- SelectingProviderEventArgs.cs
- MasterPageCodeDomTreeGenerator.cs
- List.cs
- TypeUtil.cs
- AssociatedControlConverter.cs
- CollectionAdapters.cs
- ComponentTray.cs
- DynamicResourceExtension.cs
- CodeParameterDeclarationExpressionCollection.cs
- SQLInt16Storage.cs
- ComponentSerializationService.cs
- FontConverter.cs
- infer.cs
- JulianCalendar.cs
- Method.cs
- UndoEngine.cs
- ReachSerializer.cs
- GlyphingCache.cs
- SQLMoneyStorage.cs
- ReadOnlyDictionary.cs
- Panel.cs
- AlgoModule.cs
- Span.cs
- ADConnectionHelper.cs
- WsatConfiguration.cs
- XmlWhitespace.cs
- BindingWorker.cs
- DiscoveryDocumentReference.cs
- SizeAnimation.cs
- ToolboxItemImageConverter.cs
- HttpRequest.cs
- CodeDelegateInvokeExpression.cs
- MaskPropertyEditor.cs
- ScriptResourceAttribute.cs
- WebPartConnectionsConfigureVerb.cs
- ObjectQuery.cs
- SequenceNumber.cs
- CodeDomSerializer.cs
- TextMetrics.cs
- Translator.cs