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
- webbrowsersite.cs
- TextPattern.cs
- handlecollector.cs
- XsltArgumentList.cs
- pingexception.cs
- CommandCollectionEditor.cs
- Executor.cs
- ListViewSelectEventArgs.cs
- WindowsFormsSectionHandler.cs
- SubMenuStyle.cs
- CacheEntry.cs
- odbcmetadatacolumnnames.cs
- Or.cs
- TextEndOfLine.cs
- PLINQETWProvider.cs
- SignedXml.cs
- Line.cs
- CorrelationQueryBehavior.cs
- PaintValueEventArgs.cs
- CultureInfo.cs
- EnvelopedSignatureTransform.cs
- OleDbFactory.cs
- ListViewSelectEventArgs.cs
- DataTableTypeConverter.cs
- PathFigureCollectionConverter.cs
- BitSet.cs
- BindStream.cs
- HMACMD5.cs
- SoapServerMessage.cs
- ObjectItemNoOpAssemblyLoader.cs
- DoubleLinkListEnumerator.cs
- WebConvert.cs
- ConnectionInterfaceCollection.cs
- TextureBrush.cs
- PrinterResolution.cs
- RSACryptoServiceProvider.cs
- SymLanguageType.cs
- TransformationRules.cs
- DoubleAnimationClockResource.cs
- DateTimeOffsetAdapter.cs
- TypeGenericEnumerableViewSchema.cs
- WebServiceHandlerFactory.cs
- OrderedDictionary.cs
- DependencyObject.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- COM2Enum.cs
- DesignTimeTemplateParser.cs
- XamlDesignerSerializationManager.cs
- OleDbConnectionInternal.cs
- Propagator.JoinPropagator.cs
- OleDbRowUpdatedEvent.cs
- Stylesheet.cs
- MobileControlDesigner.cs
- SecurityChannelFaultConverter.cs
- DesignTimeVisibleAttribute.cs
- OleDbDataReader.cs
- FixedSOMSemanticBox.cs
- TemplatedMailWebEventProvider.cs
- IisTraceWebEventProvider.cs
- XmlIlGenerator.cs
- DocumentSequenceHighlightLayer.cs
- XmlAnyAttributeAttribute.cs
- CodePrimitiveExpression.cs
- Odbc32.cs
- DefaultBindingPropertyAttribute.cs
- ProviderSettings.cs
- Documentation.cs
- MetadataArtifactLoaderComposite.cs
- Types.cs
- EntityDataSourceChangingEventArgs.cs
- StatusStrip.cs
- CacheMemory.cs
- Line.cs
- EnumBuilder.cs
- ButtonRenderer.cs
- EpmTargetTree.cs
- ArraySet.cs
- ResizeGrip.cs
- EpmContentDeSerializer.cs
- OutputCacheSettingsSection.cs
- SecureEnvironment.cs
- CultureInfo.cs
- XsltCompileContext.cs
- ProfileGroupSettings.cs
- GatewayDefinition.cs
- DataStorage.cs
- SqlClientWrapperSmiStream.cs
- XmlCustomFormatter.cs
- MenuItemBinding.cs
- SystemTcpConnection.cs
- StringUtil.cs
- FieldBuilder.cs
- CalendarItem.cs
- processwaithandle.cs
- DesignTimeTemplateParser.cs
- NavigationPropertySingletonExpression.cs
- RegexCode.cs
- AdornerPresentationContext.cs
- ApplicationSecurityManager.cs
- HtmlInputPassword.cs