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
- PagePropertiesChangingEventArgs.cs
- Baml2006Reader.cs
- SqlServer2KCompatibilityCheck.cs
- DoWorkEventArgs.cs
- ConfigXmlWhitespace.cs
- XamlTreeBuilder.cs
- DispatcherExceptionEventArgs.cs
- RangeValuePattern.cs
- PlatformCulture.cs
- Transform.cs
- Region.cs
- Debug.cs
- ServiceAuthorizationBehavior.cs
- BitmapImage.cs
- WindowsListViewGroupHelper.cs
- CodeSnippetStatement.cs
- SqlServer2KCompatibilityCheck.cs
- UnsafeNativeMethods.cs
- Console.cs
- DataTableClearEvent.cs
- Tuple.cs
- ZoneLinkButton.cs
- CheckBoxAutomationPeer.cs
- MissingManifestResourceException.cs
- HwndMouseInputProvider.cs
- VideoDrawing.cs
- DataServiceRequestOfT.cs
- BinaryWriter.cs
- ViewCellSlot.cs
- DBSchemaRow.cs
- RegexMatchCollection.cs
- InputBinding.cs
- InvalidAsynchronousStateException.cs
- BuiltInExpr.cs
- Screen.cs
- VirtualizedCellInfoCollection.cs
- NameTable.cs
- PrintControllerWithStatusDialog.cs
- WinEventHandler.cs
- PrinterUnitConvert.cs
- DataObject.cs
- SafeCertificateStore.cs
- UIElement3D.cs
- EventArgs.cs
- NTAccount.cs
- GridItemCollection.cs
- WebContentFormatHelper.cs
- SoapInteropTypes.cs
- MultipleViewPatternIdentifiers.cs
- PathParser.cs
- StateInitialization.cs
- DependencyObject.cs
- FillRuleValidation.cs
- SQLMoneyStorage.cs
- NavigationWindowAutomationPeer.cs
- SafeCertificateContext.cs
- FormsAuthenticationModule.cs
- CustomAssemblyResolver.cs
- BounceEase.cs
- LineBreakRecord.cs
- InfoCardArgumentException.cs
- Literal.cs
- XmlExpressionDumper.cs
- ReferentialConstraint.cs
- TableItemPatternIdentifiers.cs
- ColorAnimationUsingKeyFrames.cs
- DataGridTextBox.cs
- WindowsTooltip.cs
- UserControl.cs
- XsdCachingReader.cs
- GiveFeedbackEvent.cs
- OdbcConnectionString.cs
- SqlTypeSystemProvider.cs
- DataSourceSelectArguments.cs
- SqlConnectionManager.cs
- DebugTracing.cs
- documentsequencetextcontainer.cs
- XmlDataProvider.cs
- GC.cs
- ProjectedWrapper.cs
- LineSegment.cs
- VBCodeProvider.cs
- ImageMetadata.cs
- _ShellExpression.cs
- FamilyMapCollection.cs
- CookieProtection.cs
- BindUriHelper.cs
- DataGridColumnHeader.cs
- XPathNodeList.cs
- SystemResourceHost.cs
- HighlightComponent.cs
- IgnoreDeviceFilterElement.cs
- ImageClickEventArgs.cs
- NavigateEvent.cs
- KerberosRequestorSecurityTokenAuthenticator.cs
- ReadOnlyDataSourceView.cs
- InputMethod.cs
- TableCellsCollectionEditor.cs
- ToolBarOverflowPanel.cs
- DataBindingCollection.cs