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
- DoubleLink.cs
- TypeConverterHelper.cs
- LineServicesCallbacks.cs
- SystemColors.cs
- ComboBox.cs
- VirtualizingStackPanel.cs
- XmlSchemaAnnotation.cs
- SchemaHelper.cs
- CompositeFontFamily.cs
- TextPattern.cs
- Utils.cs
- ColumnTypeConverter.cs
- MetadataExchangeBindings.cs
- NativeMethods.cs
- AssemblyCollection.cs
- MoveSizeWinEventHandler.cs
- CodeDomSerializerBase.cs
- TimeoutException.cs
- SpellCheck.cs
- TableRow.cs
- NameObjectCollectionBase.cs
- IdentifierService.cs
- Icon.cs
- SynchronizedChannelCollection.cs
- RijndaelManaged.cs
- CreateRefExpr.cs
- CanonicalXml.cs
- ClientSettings.cs
- RowBinding.cs
- StrongTypingException.cs
- DummyDataSource.cs
- DataGridViewColumn.cs
- CompiledQueryCacheKey.cs
- EmptyEnumerable.cs
- MethodBuilder.cs
- MailAddressCollection.cs
- IDQuery.cs
- StartFileNameEditor.cs
- ClosableStream.cs
- OutKeywords.cs
- messageonlyhwndwrapper.cs
- BitmapEffectInput.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- StylusPlugin.cs
- ButtonBaseAutomationPeer.cs
- WindowsListViewItem.cs
- XmlTextEncoder.cs
- WebSysDescriptionAttribute.cs
- SchemaTableOptionalColumn.cs
- DependencyPropertyKind.cs
- COM2IDispatchConverter.cs
- SQLStringStorage.cs
- DispatcherObject.cs
- PathGeometry.cs
- AssemblyNameProxy.cs
- SqlCrossApplyToCrossJoin.cs
- DependencyProperty.cs
- ListViewDeletedEventArgs.cs
- ProcessHostMapPath.cs
- WinFormsComponentEditor.cs
- FlowLayout.cs
- Stack.cs
- SQLRoleProvider.cs
- ExpressionPrefixAttribute.cs
- MapPathBasedVirtualPathProvider.cs
- TableHeaderCell.cs
- ProfileInfo.cs
- IsolatedStorageFilePermission.cs
- EmptyElement.cs
- ColorIndependentAnimationStorage.cs
- UTF7Encoding.cs
- ReturnType.cs
- SelectionPatternIdentifiers.cs
- EntityTransaction.cs
- ClientApiGenerator.cs
- ImageIndexConverter.cs
- SqlConnectionString.cs
- NavigationCommands.cs
- RectAnimation.cs
- WindowVisualStateTracker.cs
- PropertyGroupDescription.cs
- TemplateInstanceAttribute.cs
- controlskin.cs
- SudsParser.cs
- Transform3D.cs
- NativeMethods.cs
- OuterGlowBitmapEffect.cs
- DataGridViewAccessibleObject.cs
- EndpointDispatcher.cs
- PenContexts.cs
- InlineUIContainer.cs
- DbParameterCollectionHelper.cs
- _ListenerResponseStream.cs
- Method.cs
- XmlBindingWorker.cs
- XPathArrayIterator.cs
- BezierSegment.cs
- CollectionBase.cs
- BevelBitmapEffect.cs
- ETagAttribute.cs