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
- SparseMemoryStream.cs
- XmlIncludeAttribute.cs
- FSWPathEditor.cs
- XmlParser.cs
- ListMarkerSourceInfo.cs
- ObjectItemAttributeAssemblyLoader.cs
- TreeWalker.cs
- BaseConfigurationRecord.cs
- SynchronousChannel.cs
- SynchronizationFilter.cs
- CheckBox.cs
- XsdValidatingReader.cs
- SpellCheck.cs
- SystemColors.cs
- Matrix3DConverter.cs
- SubMenuStyleCollection.cs
- ClientCredentialsSecurityTokenManager.cs
- TextServicesCompartment.cs
- GroupLabel.cs
- TextDocumentView.cs
- DiscardableAttribute.cs
- DbConnectionPoolOptions.cs
- CodeTypeMember.cs
- XamlToRtfParser.cs
- HtmlTable.cs
- OleDbConnectionFactory.cs
- QueryProcessor.cs
- WebPartConnectionCollection.cs
- Condition.cs
- TemplatedAdorner.cs
- Touch.cs
- SafeNativeMethodsMilCoreApi.cs
- ModifierKeysValueSerializer.cs
- ListDataHelper.cs
- ExpressionBuilderCollection.cs
- StateItem.cs
- PtsCache.cs
- CompilerScope.cs
- ExecutionContext.cs
- SHA1.cs
- WebPartTracker.cs
- CodePageEncoding.cs
- ImageDrawing.cs
- EventHandlingScope.cs
- DependsOnAttribute.cs
- metrodevice.cs
- ConstraintEnumerator.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- ToolStripOverflow.cs
- ModelUIElement3D.cs
- SessionStateContainer.cs
- InlineObject.cs
- OdbcParameter.cs
- DataGridViewCellStyleBuilderDialog.cs
- cookiecontainer.cs
- CellIdBoolean.cs
- BorderGapMaskConverter.cs
- XsdDuration.cs
- ClientEventManager.cs
- UrlPath.cs
- StringCollection.cs
- TemplateParser.cs
- BamlBinaryReader.cs
- Quad.cs
- GlobalItem.cs
- OdbcFactory.cs
- ReadOnlyDataSource.cs
- WindowsTooltip.cs
- BoundColumn.cs
- _ConnectionGroup.cs
- CriticalHandle.cs
- CodeGenerator.cs
- TableAdapterManagerHelper.cs
- TimeSpanMinutesConverter.cs
- MenuTracker.cs
- OletxResourceManager.cs
- CompositeDesignerAccessibleObject.cs
- BindingCollection.cs
- TempFiles.cs
- dataSvcMapFileLoader.cs
- Attributes.cs
- KeyGesture.cs
- DataListCommandEventArgs.cs
- XmlSchemaSet.cs
- ClusterSafeNativeMethods.cs
- WeakReferenceEnumerator.cs
- InitializationEventAttribute.cs
- Stylesheet.cs
- RuleInfoComparer.cs
- SecurityDocument.cs
- Invariant.cs
- TrackingServices.cs
- ZoneMembershipCondition.cs
- SystemTcpConnection.cs
- sqlinternaltransaction.cs
- RoleGroupCollection.cs
- InternalConfigRoot.cs
- safex509handles.cs
- TypefaceMap.cs
- SerializationEventsCache.cs