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
- ScriptingWebServicesSectionGroup.cs
- MailAddressParser.cs
- XmlTextReaderImpl.cs
- PersistenceTypeAttribute.cs
- BaseCollection.cs
- Misc.cs
- SmtpNtlmAuthenticationModule.cs
- sqlnorm.cs
- EncryptedPackageFilter.cs
- XmlSchema.cs
- XPathArrayIterator.cs
- DesignerSerializationVisibilityAttribute.cs
- CommonRemoteMemoryBlock.cs
- JsonFormatMapping.cs
- BitmapData.cs
- CommandID.cs
- TargetException.cs
- StrokeDescriptor.cs
- SpellerHighlightLayer.cs
- Point3DCollection.cs
- FileDialogCustomPlaces.cs
- WebBrowserHelper.cs
- ArrayTypeMismatchException.cs
- SqlBuffer.cs
- dataobject.cs
- IMembershipProvider.cs
- WindowsSysHeader.cs
- X509Certificate2Collection.cs
- FontEmbeddingManager.cs
- BasicExpressionVisitor.cs
- FileDialog.cs
- DataGridPagerStyle.cs
- EncryptRequest.cs
- SoapWriter.cs
- MailAddress.cs
- InstallerTypeAttribute.cs
- LinkedResourceCollection.cs
- DebugView.cs
- DefinitionBase.cs
- UnsafeNativeMethods.cs
- AuthorizationContext.cs
- DateTimeConstantAttribute.cs
- DefaultBinder.cs
- WebPartCollection.cs
- XmlResolver.cs
- TypeUtil.cs
- InputElement.cs
- XmlSchemaComplexType.cs
- XPathDocumentNavigator.cs
- DispatcherHookEventArgs.cs
- QuaternionAnimation.cs
- AssemblyCollection.cs
- FilePresentation.cs
- PolicyLevel.cs
- XmlName.cs
- XmlDataCollection.cs
- SqlRowUpdatedEvent.cs
- CertificateReferenceElement.cs
- Table.cs
- TreeNodeBindingCollection.cs
- Wizard.cs
- Schema.cs
- RoutedEventArgs.cs
- BaseTemplateCodeDomTreeGenerator.cs
- SystemTcpConnection.cs
- _ConnectionGroup.cs
- WeakReference.cs
- UrlMappingCollection.cs
- MenuCommandsChangedEventArgs.cs
- SqlProviderManifest.cs
- LinqDataSourceContextEventArgs.cs
- BoolExpression.cs
- SerializationSectionGroup.cs
- BackgroundWorker.cs
- DataDocumentXPathNavigator.cs
- controlskin.cs
- SessionStateSection.cs
- ConfigurationStrings.cs
- ToolTip.cs
- Int16Animation.cs
- MILUtilities.cs
- XsdDateTime.cs
- PartitionResolver.cs
- ActionMismatchAddressingException.cs
- ViewCellRelation.cs
- IISUnsafeMethods.cs
- CallId.cs
- VisualStyleInformation.cs
- columnmapkeybuilder.cs
- ContextStaticAttribute.cs
- CapabilitiesSection.cs
- ObjectPropertyMapping.cs
- PropertyTabAttribute.cs
- BufferModesCollection.cs
- SocketException.cs
- ICspAsymmetricAlgorithm.cs
- HttpStreamXmlDictionaryReader.cs
- bindurihelper.cs
- CodeCatchClauseCollection.cs
- HtmlInputText.cs