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
- DataGridView.cs
- PermissionSetTriple.cs
- CannotUnloadAppDomainException.cs
- TextRangeAdaptor.cs
- VoiceChangeEventArgs.cs
- FormViewModeEventArgs.cs
- DefaultObjectMappingItemCollection.cs
- WeakReferenceList.cs
- DrawingBrush.cs
- DPCustomTypeDescriptor.cs
- HostExecutionContextManager.cs
- WriterOutput.cs
- Certificate.cs
- BindingCollection.cs
- PageThemeCodeDomTreeGenerator.cs
- NameValuePermission.cs
- ClassicBorderDecorator.cs
- DataTableClearEvent.cs
- Binding.cs
- ProviderCollection.cs
- StreamResourceInfo.cs
- DependentTransaction.cs
- ThrowHelper.cs
- XPathNodeInfoAtom.cs
- ByteStreamMessageEncodingElement.cs
- StringComparer.cs
- XmlIlTypeHelper.cs
- DefaultSettingsSection.cs
- XPathSelectionIterator.cs
- RenderData.cs
- TargetConverter.cs
- SQLBinary.cs
- DataGridViewCellEventArgs.cs
- GridViewColumn.cs
- SerializationObjectManager.cs
- IApplicationTrustManager.cs
- OleDbPermission.cs
- SymbolMethod.cs
- StringUtil.cs
- ArrayExtension.cs
- PanelDesigner.cs
- LinqDataSourceInsertEventArgs.cs
- TaskCanceledException.cs
- TabControlEvent.cs
- ContractReference.cs
- SequenceDesignerAccessibleObject.cs
- CodeComment.cs
- ApplicationProxyInternal.cs
- BrowserDefinitionCollection.cs
- OutputCacheProfile.cs
- IndexExpression.cs
- ResourceDisplayNameAttribute.cs
- GeometryHitTestResult.cs
- BitConverter.cs
- Application.cs
- GridViewSortEventArgs.cs
- AdCreatedEventArgs.cs
- GeometryCombineModeValidation.cs
- XmlSchemaDatatype.cs
- RelationshipFixer.cs
- PtsContext.cs
- GridEntryCollection.cs
- CryptoApi.cs
- FormatConvertedBitmap.cs
- MessageDescriptionCollection.cs
- TextTreePropertyUndoUnit.cs
- SafeRightsManagementSessionHandle.cs
- UnsafeNativeMethods.cs
- StrokeCollectionDefaultValueFactory.cs
- PostBackOptions.cs
- HtmlUtf8RawTextWriter.cs
- RulePatternOps.cs
- LinkArea.cs
- HashAlgorithm.cs
- COM2PropertyPageUITypeConverter.cs
- ExpressionContext.cs
- DateTimeFormatInfoScanner.cs
- FormattedTextSymbols.cs
- MembershipPasswordException.cs
- InternalSafeNativeMethods.cs
- Content.cs
- DataRecordInternal.cs
- XPathAxisIterator.cs
- DetailsViewPagerRow.cs
- AggregatePushdown.cs
- SafeRegistryKey.cs
- XmlSchemaInclude.cs
- AssemblyNameProxy.cs
- PlainXmlSerializer.cs
- RemoteDebugger.cs
- AsyncOperationManager.cs
- WindowsSecurityTokenAuthenticator.cs
- sqlinternaltransaction.cs
- DbParameterHelper.cs
- TextEditorCopyPaste.cs
- FunctionQuery.cs
- Speller.cs
- SqlConnectionManager.cs
- ConfigXmlReader.cs
- MenuItemStyleCollection.cs