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
- ProxyGenerator.cs
- UnsafeNativeMethodsTablet.cs
- DataGridViewImageColumn.cs
- BinaryFormatterWriter.cs
- DoubleConverter.cs
- SocketInformation.cs
- ReadOnlyNameValueCollection.cs
- SelectionListComponentEditor.cs
- FormViewDeleteEventArgs.cs
- ReadWriteSpinLock.cs
- SystemMulticastIPAddressInformation.cs
- CheckBoxField.cs
- HtmlCommandAdapter.cs
- ImpersonateTokenRef.cs
- ValidatorUtils.cs
- DurableMessageDispatchInspector.cs
- JoinQueryOperator.cs
- DataSourceProvider.cs
- HMACSHA512.cs
- XmlReturnReader.cs
- TableSectionStyle.cs
- Effect.cs
- AssemblyNameProxy.cs
- ToolStripGripRenderEventArgs.cs
- XamlUtilities.cs
- documentsequencetextpointer.cs
- ClientScriptManagerWrapper.cs
- SimpleWorkerRequest.cs
- InternalDuplexBindingElement.cs
- XmlQuerySequence.cs
- XmlSchemaSimpleContent.cs
- Size3DValueSerializer.cs
- FloaterBaseParagraph.cs
- DataGridViewRowHeaderCell.cs
- DetailsViewUpdatedEventArgs.cs
- CacheModeValueSerializer.cs
- PageBreakRecord.cs
- RectConverter.cs
- SelectionHighlightInfo.cs
- DataViewManagerListItemTypeDescriptor.cs
- ObjectToken.cs
- Rights.cs
- XamlParser.cs
- InitializingNewItemEventArgs.cs
- UpdateException.cs
- DrawingGroupDrawingContext.cs
- PassportAuthenticationModule.cs
- ResourcePermissionBaseEntry.cs
- IncrementalReadDecoders.cs
- GeometryValueSerializer.cs
- HtmlInputImage.cs
- ImportCatalogPart.cs
- TraceContext.cs
- HtmlTableCellCollection.cs
- DocobjHost.cs
- QilParameter.cs
- WebExceptionStatus.cs
- CoreSwitches.cs
- UpdateRecord.cs
- Single.cs
- RealizationContext.cs
- AbstractDataSvcMapFileLoader.cs
- MetadataArtifactLoaderCompositeResource.cs
- AssemblyGen.cs
- TableLayoutColumnStyleCollection.cs
- EntityDataSourceChangedEventArgs.cs
- WindowsTokenRoleProvider.cs
- HtmlToClrEventProxy.cs
- InProcStateClientManager.cs
- DataGridViewColumnCollection.cs
- HtmlValidationSummaryAdapter.cs
- FileDataSourceCache.cs
- DesignTimeParseData.cs
- AspNetSynchronizationContext.cs
- ValidationErrorEventArgs.cs
- EditCommandColumn.cs
- Menu.cs
- GridViewDeleteEventArgs.cs
- DataGridViewCellCollection.cs
- QueryOutputWriterV1.cs
- WebBrowsableAttribute.cs
- ToolStripDropDownMenu.cs
- XmlAttribute.cs
- Vector3dCollection.cs
- RawUIStateInputReport.cs
- RequiredAttributeAttribute.cs
- EventSourceCreationData.cs
- InstanceLockedException.cs
- SafeNativeMethodsCLR.cs
- WorkflowMessageEventArgs.cs
- IRCollection.cs
- Simplifier.cs
- HeaderedContentControl.cs
- SemaphoreSecurity.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- BaseCodeDomTreeGenerator.cs
- MatrixTransform.cs
- DiscoveryRequestHandler.cs
- PropertyFilterAttribute.cs
- WebPartZone.cs