Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- PathFigureCollection.cs
- PageParser.cs
- LexicalChunk.cs
- CodeTypeParameter.cs
- SoapMessage.cs
- TextModifierScope.cs
- TextureBrush.cs
- ComponentCodeDomSerializer.cs
- StylusTip.cs
- NativeCppClassAttribute.cs
- TextContainerChangedEventArgs.cs
- ToolTip.cs
- BlurBitmapEffect.cs
- MsmqInputMessage.cs
- SqlNode.cs
- ToolStripControlHost.cs
- PageVisual.cs
- ISessionStateStore.cs
- DiscoveryInnerClientAdhocCD1.cs
- RSATokenProvider.cs
- Int32Converter.cs
- PolyBezierSegmentFigureLogic.cs
- MissingMethodException.cs
- LayoutTableCell.cs
- DataPager.cs
- BuildDependencySet.cs
- ButtonAutomationPeer.cs
- HttpStreamXmlDictionaryReader.cs
- MulticastNotSupportedException.cs
- ComponentRenameEvent.cs
- StreamUpdate.cs
- odbcmetadatacollectionnames.cs
- GAC.cs
- UnknownWrapper.cs
- AsynchronousChannelMergeEnumerator.cs
- XmlChildEnumerator.cs
- Style.cs
- WpfPayload.cs
- ImageListImageEditor.cs
- AssemblyBuilderData.cs
- ProtocolElementCollection.cs
- TypeNameConverter.cs
- RegistrySecurity.cs
- Page.cs
- XPathDocumentBuilder.cs
- ByteAnimationBase.cs
- TextPenaltyModule.cs
- SecurityHeader.cs
- DesignerLabelAdapter.cs
- SendActivityValidator.cs
- keycontainerpermission.cs
- MenuItemCollection.cs
- ControlPropertyNameConverter.cs
- TextEffect.cs
- MediaTimeline.cs
- WebSysDefaultValueAttribute.cs
- M3DUtil.cs
- WebPartsPersonalization.cs
- XPathNavigatorReader.cs
- ToolStripButton.cs
- IndexingContentUnit.cs
- GPPOINTF.cs
- EncodingDataItem.cs
- ThreadExceptionEvent.cs
- HelpProvider.cs
- DateTimeParse.cs
- SectionUpdates.cs
- DictionaryBase.cs
- SimpleBitVector32.cs
- ImageSourceValueSerializer.cs
- PeerApplication.cs
- Char.cs
- DesignerSerializationManager.cs
- ThumbAutomationPeer.cs
- MergeFailedEvent.cs
- SqlDataSourceCommandEventArgs.cs
- StrictAndMessageFilter.cs
- DataListItemEventArgs.cs
- MediaPlayerState.cs
- LoadedOrUnloadedOperation.cs
- HtmlImage.cs
- MetadataSource.cs
- ZipIOLocalFileDataDescriptor.cs
- OrderByBuilder.cs
- ProxyAttribute.cs
- ResourceType.cs
- ResolveCriteria.cs
- DPTypeDescriptorContext.cs
- SmiTypedGetterSetter.cs
- OrderedHashRepartitionEnumerator.cs
- DataView.cs
- DispatchChannelSink.cs
- VirtualizedCellInfoCollection.cs
- TagMapCollection.cs
- Vector3dCollection.cs
- KeyFrames.cs
- MemberDescriptor.cs
- HttpDictionary.cs
- NumberFormatInfo.cs
- PassportAuthentication.cs