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
- MsmqHostedTransportConfiguration.cs
- WebPartConnectionsCancelEventArgs.cs
- Package.cs
- InvalidProgramException.cs
- SystemColors.cs
- DataBindingExpressionBuilder.cs
- URLEditor.cs
- XmlAtomicValue.cs
- HttpAsyncResult.cs
- DataKeyCollection.cs
- TextEncodedRawTextWriter.cs
- MatrixTransform3D.cs
- TableProviderWrapper.cs
- DynamicPropertyHolder.cs
- HttpResponse.cs
- ChangeBlockUndoRecord.cs
- FileLoadException.cs
- DataGridParentRows.cs
- TreeNodeStyle.cs
- ActivitiesCollection.cs
- SqlParameter.cs
- Point3DValueSerializer.cs
- ConfigurationElementCollection.cs
- BindingNavigatorDesigner.cs
- TimeSpanParse.cs
- SqlDataAdapter.cs
- Util.cs
- WindowsListViewGroupHelper.cs
- MeasureItemEvent.cs
- CroppedBitmap.cs
- HttpModulesInstallComponent.cs
- BindableAttribute.cs
- SessionPageStatePersister.cs
- DataRecord.cs
- TransformedBitmap.cs
- WebPartEditorApplyVerb.cs
- SimpleMailWebEventProvider.cs
- LineServicesCallbacks.cs
- SqlCacheDependencyDatabase.cs
- DbInsertCommandTree.cs
- Parsers.cs
- DesignerActionItemCollection.cs
- SoapSchemaMember.cs
- StringFunctions.cs
- TransactionProxy.cs
- FlowDocumentScrollViewer.cs
- AutoSizeComboBox.cs
- FolderBrowserDialog.cs
- FontFamilyValueSerializer.cs
- XsltException.cs
- DiscoveryClientDocuments.cs
- TargetControlTypeAttribute.cs
- FastPropertyAccessor.cs
- StrongTypingException.cs
- TemplateComponentConnector.cs
- WindowsRebar.cs
- AdornerHitTestResult.cs
- FilteredXmlReader.cs
- CellIdBoolean.cs
- UIElementPropertyUndoUnit.cs
- NonVisualControlAttribute.cs
- CodeIdentifiers.cs
- AnnotationStore.cs
- GridViewUpdatedEventArgs.cs
- FormatStringEditor.cs
- XmlReader.cs
- LineServicesRun.cs
- InvalidWMPVersionException.cs
- BaseCodePageEncoding.cs
- DescendantQuery.cs
- _OSSOCK.cs
- ContractMapping.cs
- ToolStripDropDownClosingEventArgs.cs
- TextAutomationPeer.cs
- DLinqColumnProvider.cs
- mediaeventshelper.cs
- FrameworkContextData.cs
- CryptoStream.cs
- AddingNewEventArgs.cs
- Boolean.cs
- XmlWrappingWriter.cs
- Decimal.cs
- MostlySingletonList.cs
- unitconverter.cs
- BaseContextMenu.cs
- ClientProxyGenerator.cs
- OLEDB_Enum.cs
- InplaceBitmapMetadataWriter.cs
- LicFileLicenseProvider.cs
- TextTreeUndoUnit.cs
- RequestCachingSection.cs
- SmiXetterAccessMap.cs
- VectorCollectionConverter.cs
- HtmlMeta.cs
- DefaultMemberAttribute.cs
- WorkflowOwnershipException.cs
- XmlExpressionDumper.cs
- Effect.cs
- SmtpNegotiateAuthenticationModule.cs
- XhtmlBasicPanelAdapter.cs