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
- ISAPIApplicationHost.cs
- HitTestDrawingContextWalker.cs
- ResourcePart.cs
- FaultPropagationRecord.cs
- RichTextBoxContextMenu.cs
- Error.cs
- CustomErrorCollection.cs
- BodyWriter.cs
- FileInfo.cs
- FixedSOMPageConstructor.cs
- HttpModuleCollection.cs
- WindowsProgressbar.cs
- TransformerInfoCollection.cs
- MediaSystem.cs
- WsatTransactionFormatter.cs
- ListViewInsertionMark.cs
- SqlDataSourceCache.cs
- ReadContentAsBinaryHelper.cs
- ConstNode.cs
- DataGridTextBoxColumn.cs
- TreeChangeInfo.cs
- DropTarget.cs
- MaxMessageSizeStream.cs
- DictionaryBase.cs
- RowSpanVector.cs
- LinqMaximalSubtreeNominator.cs
- InfoCardSymmetricCrypto.cs
- TemplateColumn.cs
- GuidTagList.cs
- CustomError.cs
- TextRange.cs
- WsatConfiguration.cs
- InputManager.cs
- XmlSchemaGroup.cs
- DSASignatureDeformatter.cs
- QilValidationVisitor.cs
- PaperSource.cs
- FileRecordSequenceCompletedAsyncResult.cs
- ObjectComplexPropertyMapping.cs
- DesignBinding.cs
- ComPlusServiceLoader.cs
- CapiSafeHandles.cs
- WebPartVerbCollection.cs
- ChannelManager.cs
- HierarchicalDataBoundControl.cs
- FlowDocumentReader.cs
- ActiveXHelper.cs
- DoubleLink.cs
- CqlGenerator.cs
- StickyNoteHelper.cs
- TextElementEnumerator.cs
- XsdValidatingReader.cs
- DataListItemEventArgs.cs
- Image.cs
- DataServiceQueryProvider.cs
- ChannelEndpointElement.cs
- Int32RectValueSerializer.cs
- QilInvokeLateBound.cs
- SpecularMaterial.cs
- GeometryModel3D.cs
- MetadataItemSerializer.cs
- RawStylusActions.cs
- EventBuilder.cs
- GuidConverter.cs
- GeneralTransform.cs
- SoapUnknownHeader.cs
- Authorization.cs
- UniqueID.cs
- DataGridViewBand.cs
- RegexCharClass.cs
- Model3D.cs
- Internal.cs
- ItemContainerProviderWrapper.cs
- GeneralTransform3DGroup.cs
- ConnectionStringSettingsCollection.cs
- GlyphRun.cs
- AdapterDictionary.cs
- PersonalizationEntry.cs
- ComponentResourceKey.cs
- EditorPartChrome.cs
- CheckBoxBaseAdapter.cs
- RepeatButton.cs
- JoinGraph.cs
- WebPartTracker.cs
- SimpleTypesSurrogate.cs
- SystemIcons.cs
- TdsParameterSetter.cs
- XmlNamespaceManager.cs
- KeyManager.cs
- FlowPosition.cs
- SignedXml.cs
- Table.cs
- SharedStream.cs
- COM2ExtendedBrowsingHandler.cs
- KeySplineConverter.cs
- ResourceReader.cs
- PersistenceException.cs
- DefaultBinder.cs
- PrintPreviewGraphics.cs
- RegexReplacement.cs