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
- FreeFormDesigner.cs
- ThrowHelper.cs
- SpotLight.cs
- LinqDataView.cs
- WebServiceEndpoint.cs
- FixedHighlight.cs
- CategoryAttribute.cs
- VectorAnimationUsingKeyFrames.cs
- Rotation3D.cs
- String.cs
- FrameworkPropertyMetadata.cs
- ComEventsSink.cs
- OrthographicCamera.cs
- PersistenceProviderElement.cs
- SecurityKeyIdentifierClause.cs
- ToolStripDropDownButton.cs
- StaticSiteMapProvider.cs
- StandardRuntimeEnumValidatorAttribute.cs
- RealProxy.cs
- CustomErrorCollection.cs
- CopyAction.cs
- ConfigurationSectionGroup.cs
- IntegrationExceptionEventArgs.cs
- MessageSecurityOverHttpElement.cs
- PasswordBox.cs
- InstanceData.cs
- SQLMoneyStorage.cs
- EventLogTraceListener.cs
- Emitter.cs
- DocumentPageHost.cs
- DataRecord.cs
- TdsEnums.cs
- FixedStringLookup.cs
- CacheMemory.cs
- TargetControlTypeCache.cs
- ConfigXmlReader.cs
- StatusBar.cs
- SoapInteropTypes.cs
- altserialization.cs
- CurrencyWrapper.cs
- GroupAggregateExpr.cs
- SqlDuplicator.cs
- FormViewPagerRow.cs
- EntitySetDataBindingList.cs
- ContentPlaceHolder.cs
- WebCategoryAttribute.cs
- CreateParams.cs
- MediaElementAutomationPeer.cs
- HeaderedItemsControl.cs
- ShapingEngine.cs
- CryptographicAttribute.cs
- AdCreatedEventArgs.cs
- EncoderFallback.cs
- AuthenticationModulesSection.cs
- DataBoundControlHelper.cs
- IndicFontClient.cs
- PartitionedDataSource.cs
- TraceLevelStore.cs
- X509Certificate2.cs
- PackageFilter.cs
- Rotation3D.cs
- OperandQuery.cs
- MobileComponentEditorPage.cs
- TextBox.cs
- XmlILAnnotation.cs
- AsyncStreamReader.cs
- XmlComment.cs
- Baml2006ReaderContext.cs
- CryptoStream.cs
- _SSPIWrapper.cs
- WebScriptMetadataMessage.cs
- DiscoveryDocumentReference.cs
- XpsS0ValidatingLoader.cs
- CodeAttachEventStatement.cs
- IntPtr.cs
- Clipboard.cs
- DataControlPagerLinkButton.cs
- ControlPaint.cs
- XmlBindingWorker.cs
- TargetParameterCountException.cs
- UrlPath.cs
- WebPartConnectVerb.cs
- InvalidPipelineStoreException.cs
- CompilerTypeWithParams.cs
- _ConnectStream.cs
- EmptyQuery.cs
- UnsafeNativeMethods.cs
- SimpleMailWebEventProvider.cs
- NotImplementedException.cs
- RoleManagerEventArgs.cs
- BitmapSourceSafeMILHandle.cs
- MappingSource.cs
- Screen.cs
- WorkItem.cs
- OperationContext.cs
- Point3DCollectionConverter.cs
- HwndSourceParameters.cs
- ProxyWebPart.cs
- WebPartUtil.cs
- LayoutTable.cs