Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CommonUI / System / Drawing / BufferedGraphicsManager.cs / 1305376 / 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
- IndentTextWriter.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- DynamicPropertyHolder.cs
- EdmToObjectNamespaceMap.cs
- NamespaceImport.cs
- WebSysDisplayNameAttribute.cs
- DeclarativeCatalogPart.cs
- RealizationDrawingContextWalker.cs
- TableChangeProcessor.cs
- TogglePattern.cs
- SourceSwitch.cs
- UnionExpr.cs
- WSDualHttpSecurity.cs
- MemoryMappedView.cs
- SqlUtil.cs
- WebPartCancelEventArgs.cs
- SqlProcedureAttribute.cs
- XmlLoader.cs
- EnumerableRowCollectionExtensions.cs
- RoutedEventValueSerializer.cs
- ProviderConnectionPointCollection.cs
- InstanceDataCollection.cs
- CalculatedColumn.cs
- DropTarget.cs
- XmlSchemaComplexContent.cs
- NativeMethods.cs
- LayoutTableCell.cs
- DBCSCodePageEncoding.cs
- ScrollBar.cs
- SecurityResources.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- HttpPostServerProtocol.cs
- SharedStream.cs
- PeerIPHelper.cs
- ArrayList.cs
- XmlEntity.cs
- BehaviorEditorPart.cs
- SystemIPInterfaceStatistics.cs
- ProvidePropertyAttribute.cs
- TransportBindingElementImporter.cs
- ClientBuildManagerCallback.cs
- CombinedGeometry.cs
- Deflater.cs
- ADConnectionHelper.cs
- ToolStripDropDown.cs
- TaskSchedulerException.cs
- AppDomainResourcePerfCounters.cs
- SimpleBitVector32.cs
- MarshalDirectiveException.cs
- XmlQueryCardinality.cs
- CheckBox.cs
- NotifyParentPropertyAttribute.cs
- InstanceLockLostException.cs
- Brush.cs
- DataGridViewColumnConverter.cs
- SessionPageStatePersister.cs
- SqlEnums.cs
- BindingContext.cs
- NavigatingCancelEventArgs.cs
- TextWriterTraceListener.cs
- BlobPersonalizationState.cs
- SortedList.cs
- CellCreator.cs
- Double.cs
- GenericUriParser.cs
- GlyphShapingProperties.cs
- TaskExceptionHolder.cs
- UrlUtility.cs
- ReliableSession.cs
- BrowserCapabilitiesCodeGenerator.cs
- ImageKeyConverter.cs
- _ContextAwareResult.cs
- ResourceContainer.cs
- CompositeControl.cs
- ApplicationGesture.cs
- ContentOperations.cs
- SplineKeyFrames.cs
- XamlNamespaceHelper.cs
- ItemCollection.cs
- Vector3DConverter.cs
- UnknownBitmapEncoder.cs
- PrinterSettings.cs
- BinaryWriter.cs
- AtomEntry.cs
- Permission.cs
- SevenBitStream.cs
- CounterSetInstanceCounterDataSet.cs
- MouseEvent.cs
- HintTextConverter.cs
- CngAlgorithmGroup.cs
- RectAnimationClockResource.cs
- Serializer.cs
- DataGridViewCheckBoxCell.cs
- DatePickerAutomationPeer.cs
- TextRangeEditTables.cs
- StaticContext.cs
- UniqueEventHelper.cs
- WebControlsSection.cs
- CharEnumerator.cs
- CompModSwitches.cs