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
- DiagnosticTraceSource.cs
- ServiceDescriptionReflector.cs
- StreamSecurityUpgradeAcceptor.cs
- HostedElements.cs
- EntityAdapter.cs
- TriggerCollection.cs
- XmlSchemaSimpleTypeUnion.cs
- DataServiceEntityAttribute.cs
- ApplicationDirectory.cs
- ToolStripContainer.cs
- UpdatePanel.cs
- HttpCapabilitiesBase.cs
- SessionStateSection.cs
- DeploymentSection.cs
- HtmlHead.cs
- UriParserTemplates.cs
- Matrix.cs
- ServicePoint.cs
- WorkflowOperationBehavior.cs
- WebPartRestoreVerb.cs
- CroppedBitmap.cs
- GroupLabel.cs
- SchemaCollectionCompiler.cs
- TriggerAction.cs
- SessionIDManager.cs
- ProgressBar.cs
- AmbientLight.cs
- dataprotectionpermission.cs
- AssociationTypeEmitter.cs
- Opcode.cs
- ColumnTypeConverter.cs
- BindingsCollection.cs
- SystemNetHelpers.cs
- StylusButtonEventArgs.cs
- CompositionAdorner.cs
- ProtectedConfigurationSection.cs
- KeyNameIdentifierClause.cs
- WizardStepBase.cs
- Point3DCollectionConverter.cs
- FontConverter.cs
- HitTestDrawingContextWalker.cs
- DataContractSerializerOperationGenerator.cs
- BulletChrome.cs
- ColumnResizeUndoUnit.cs
- CommandLibraryHelper.cs
- WindowInteractionStateTracker.cs
- ModelItemKeyValuePair.cs
- ProjectionCamera.cs
- DBConnection.cs
- ServiceModelTimeSpanValidator.cs
- FormatterServices.cs
- DbConnectionPoolIdentity.cs
- ADMembershipUser.cs
- DataSourceView.cs
- HttpCookie.cs
- NullReferenceException.cs
- IdentityReference.cs
- WinFormsSpinner.cs
- WebConfigurationFileMap.cs
- ListManagerBindingsCollection.cs
- LinqDataSourceEditData.cs
- ComplexPropertyEntry.cs
- ZipArchive.cs
- SystemThemeKey.cs
- ScrollBar.cs
- CompilerError.cs
- Bits.cs
- sqlinternaltransaction.cs
- Pair.cs
- BindingValueChangedEventArgs.cs
- RuntimeEnvironment.cs
- ExtensionDataObject.cs
- ObjectQueryExecutionPlan.cs
- Schema.cs
- DivideByZeroException.cs
- SqlNodeAnnotation.cs
- VariableQuery.cs
- ComponentFactoryHelpers.cs
- ReadWriteObjectLock.cs
- MonitorWrapper.cs
- FixUpCollection.cs
- PackageFilter.cs
- ColumnWidthChangedEvent.cs
- AdCreatedEventArgs.cs
- BuiltInExpr.cs
- XamlVector3DCollectionSerializer.cs
- FactoryRecord.cs
- dataobject.cs
- ConnectionConsumerAttribute.cs
- RegexWorker.cs
- BasePattern.cs
- StreamingContext.cs
- HttpListener.cs
- GridViewColumnHeaderAutomationPeer.cs
- XmlSchema.cs
- AnimatedTypeHelpers.cs
- IntegrationExceptionEventArgs.cs
- WebChannelFactory.cs
- ReadWriteObjectLock.cs
- Scene3D.cs