Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- Visual.cs
- ErrorTableItemStyle.cs
- RadialGradientBrush.cs
- TrustSection.cs
- DocumentViewerAutomationPeer.cs
- MergeLocalizationDirectives.cs
- HtmlFormParameterReader.cs
- RightsManagementEncryptionTransform.cs
- BaseTemplateBuildProvider.cs
- Model3D.cs
- XmlUtf8RawTextWriter.cs
- GuidConverter.cs
- _DisconnectOverlappedAsyncResult.cs
- TiffBitmapEncoder.cs
- SmtpAuthenticationManager.cs
- HashCodeCombiner.cs
- SurrogateEncoder.cs
- activationcontext.cs
- SafeFileMappingHandle.cs
- ListControl.cs
- TargetInvocationException.cs
- HeaderUtility.cs
- CultureInfoConverter.cs
- ControlBuilder.cs
- ToolStripSeparatorRenderEventArgs.cs
- ValidatorCompatibilityHelper.cs
- OutputScope.cs
- WebPartConnectionsConfigureVerb.cs
- VirtualizingStackPanel.cs
- DataServiceExpressionVisitor.cs
- SQLStringStorage.cs
- OpenTypeLayout.cs
- StrongNameUtility.cs
- UnauthorizedWebPart.cs
- DependentList.cs
- TemplateControlBuildProvider.cs
- JoinTreeSlot.cs
- CanonicalXml.cs
- ParentQuery.cs
- StylusEventArgs.cs
- MsmqProcessProtocolHandler.cs
- EditBehavior.cs
- StatusBar.cs
- RayHitTestParameters.cs
- _BasicClient.cs
- VirtualDirectoryMapping.cs
- OracleParameterBinding.cs
- Transform3DCollection.cs
- DetailsViewInsertEventArgs.cs
- RemoteWebConfigurationHostServer.cs
- DataGridViewCellLinkedList.cs
- SimpleBitVector32.cs
- LinkButton.cs
- TrailingSpaceComparer.cs
- BuildDependencySet.cs
- AttachedProperty.cs
- Point3DAnimationUsingKeyFrames.cs
- _KerberosClient.cs
- RegexInterpreter.cs
- MonitorWrapper.cs
- DbgCompiler.cs
- EntityEntry.cs
- MsmqActivation.cs
- SoapHttpTransportImporter.cs
- ExtensionFile.cs
- AstNode.cs
- SqlIdentifier.cs
- WebPartAuthorizationEventArgs.cs
- SqlCacheDependencyDatabaseCollection.cs
- SizeAnimationClockResource.cs
- EventRoute.cs
- WebPartTransformerAttribute.cs
- DecimalStorage.cs
- HostedHttpContext.cs
- OracleConnectionStringBuilder.cs
- ServiceMetadataContractBehavior.cs
- TcpChannelFactory.cs
- DayRenderEvent.cs
- QuotaExceededException.cs
- RootBrowserWindowProxy.cs
- ProcessProtocolHandler.cs
- CodePropertyReferenceExpression.cs
- DisposableCollectionWrapper.cs
- FrameworkRichTextComposition.cs
- JapaneseCalendar.cs
- CompatibleComparer.cs
- TabRenderer.cs
- DataBindingExpressionBuilder.cs
- WizardPanel.cs
- LocalFileSettingsProvider.cs
- PersonalizationStateQuery.cs
- TreeNodeBinding.cs
- SchemaImporterExtensionElement.cs
- VisualStyleRenderer.cs
- LZCodec.cs
- ExecutionEngineException.cs
- EntityModelBuildProvider.cs
- RemoteWebConfigurationHostServer.cs
- WebHeaderCollection.cs
- RecognizerStateChangedEventArgs.cs