Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- Form.cs
- SchemaLookupTable.cs
- ElapsedEventArgs.cs
- CompiledRegexRunnerFactory.cs
- CodeObject.cs
- CheckBox.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- LinqDataSourceDisposeEventArgs.cs
- WhitespaceRuleReader.cs
- Utils.cs
- XmlSerializerSection.cs
- UnsafeNativeMethodsPenimc.cs
- BaseResourcesBuildProvider.cs
- TypeElement.cs
- ButtonFlatAdapter.cs
- GeneralTransformGroup.cs
- StickyNoteAnnotations.cs
- MetaColumn.cs
- OdbcEnvironmentHandle.cs
- Dictionary.cs
- WCFServiceClientProxyGenerator.cs
- AbandonedMutexException.cs
- KeyboardNavigation.cs
- IPHostEntry.cs
- CellConstant.cs
- EventProxy.cs
- CompilationPass2Task.cs
- DBConnection.cs
- CharEnumerator.cs
- TypeListConverter.cs
- ComponentEditorPage.cs
- StringBuilder.cs
- OleServicesContext.cs
- DbProviderFactoriesConfigurationHandler.cs
- StreamSecurityUpgradeInitiatorBase.cs
- CompilerCollection.cs
- SqlMethods.cs
- BinaryNode.cs
- ConnectionConsumerAttribute.cs
- BackStopAuthenticationModule.cs
- DirectoryObjectSecurity.cs
- TextServicesCompartmentEventSink.cs
- SocketException.cs
- ImmutablePropertyDescriptorGridEntry.cs
- DetailsViewUpdatedEventArgs.cs
- XmlSerializableWriter.cs
- ReadWriteSpinLock.cs
- Paragraph.cs
- ObjectItemCollection.cs
- Font.cs
- SemaphoreSlim.cs
- ObjectDataSourceWizardForm.cs
- TextBoxAutomationPeer.cs
- RangeBaseAutomationPeer.cs
- HttpCacheVaryByContentEncodings.cs
- SQLMembershipProvider.cs
- GenericTextProperties.cs
- ValueProviderWrapper.cs
- WmlPageAdapter.cs
- DesignerAttributeInfo.cs
- SQLInt32Storage.cs
- SettingsPropertyCollection.cs
- TypeToken.cs
- PolyLineSegmentFigureLogic.cs
- DeviceFiltersSection.cs
- DocumentXPathNavigator.cs
- TCPClient.cs
- ObjectItemAssemblyLoader.cs
- DoWhile.cs
- FontFamilyValueSerializer.cs
- OrderedDictionary.cs
- SqlTriggerAttribute.cs
- XmlILModule.cs
- SrgsSubset.cs
- GenericIdentity.cs
- AssemblyCollection.cs
- XhtmlTextWriter.cs
- CollectionBuilder.cs
- ButtonBase.cs
- PageMediaType.cs
- XmlSchemaAnnotated.cs
- GridViewColumn.cs
- DependencyPropertyConverter.cs
- XslAst.cs
- XmlDataContract.cs
- ClientRuntimeConfig.cs
- DuplexClientBase.cs
- DataKeyCollection.cs
- XamlTypeMapper.cs
- TextViewBase.cs
- ProfileSection.cs
- BindMarkupExtensionSerializer.cs
- LassoHelper.cs
- BinaryFormatterWriter.cs
- UInt32.cs
- EdmToObjectNamespaceMap.cs
- ProcessThreadCollection.cs
- WindowsImpersonationContext.cs
- OperationGenerator.cs
- ClientSideQueueItem.cs