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
- TypographyProperties.cs
- MissingFieldException.cs
- CertificateElement.cs
- TypeGeneratedEventArgs.cs
- BuildResultCache.cs
- DataControlLinkButton.cs
- BinaryCommonClasses.cs
- Guid.cs
- AssemblyBuilder.cs
- SortExpressionBuilder.cs
- DBBindings.cs
- DataGridTableStyleMappingNameEditor.cs
- CodeDelegateCreateExpression.cs
- ModuleBuilder.cs
- DesignSurfaceServiceContainer.cs
- PropertyDescriptor.cs
- TreeWalkHelper.cs
- AsmxEndpointPickerExtension.cs
- TextViewBase.cs
- WorkflowInspectionServices.cs
- HtmlElement.cs
- TextDecoration.cs
- SerializerWriterEventHandlers.cs
- FamilyMapCollection.cs
- XmlMemberMapping.cs
- ProfileInfo.cs
- ToolZone.cs
- StatusStrip.cs
- SecurityHelper.cs
- Invariant.cs
- DeviceFiltersSection.cs
- AsymmetricSignatureFormatter.cs
- WriteTimeStream.cs
- TabletDevice.cs
- LogicalExpr.cs
- RequestCacheEntry.cs
- QilInvokeEarlyBound.cs
- Rect3DConverter.cs
- SqlDataSourceCache.cs
- AuthenticationService.cs
- WebEvents.cs
- HttpCookie.cs
- FontResourceCache.cs
- SymmetricKeyWrap.cs
- regiisutil.cs
- _AutoWebProxyScriptHelper.cs
- SafeNativeMethods.cs
- DataException.cs
- XmlSchemaException.cs
- ContentPlaceHolder.cs
- ActivityWithResult.cs
- SatelliteContractVersionAttribute.cs
- TraceContextRecord.cs
- DescendantBaseQuery.cs
- WorkflowInstanceQuery.cs
- ServiceBusyException.cs
- DefaultTextStoreTextComposition.cs
- JournalEntryStack.cs
- XmlnsDictionary.cs
- OdbcPermission.cs
- XmlSecureResolver.cs
- _ConnectOverlappedAsyncResult.cs
- GAC.cs
- CheckBoxFlatAdapter.cs
- DataControlFieldCollection.cs
- FormsAuthenticationCredentials.cs
- XmlSiteMapProvider.cs
- NameHandler.cs
- TdsEnums.cs
- WebControlAdapter.cs
- Command.cs
- ServiceReference.cs
- dataSvcMapFileLoader.cs
- ActiveXContainer.cs
- StorageMappingItemLoader.cs
- SubstitutionList.cs
- SimpleWebHandlerParser.cs
- XmlReflectionImporter.cs
- ToggleButtonAutomationPeer.cs
- CallbackTimeoutsBehavior.cs
- TrackBar.cs
- Mutex.cs
- PasswordRecovery.cs
- SchemaComplexType.cs
- GradientStop.cs
- ApplicationCommands.cs
- DeviceContext2.cs
- BindingsCollection.cs
- EventTask.cs
- XPathNodeHelper.cs
- NetworkInterface.cs
- GenericTextProperties.cs
- ErrorCodes.cs
- MobileControlsSectionHandler.cs
- PolyLineSegment.cs
- TextTabProperties.cs
- ReaderContextStackData.cs
- XmlObjectSerializerWriteContextComplex.cs
- PropertyChangedEventArgs.cs
- MouseGestureValueSerializer.cs