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
- altserialization.cs
- TreePrinter.cs
- SmuggledIUnknown.cs
- WorkflowApplicationUnloadedException.cs
- PasswordPropertyTextAttribute.cs
- StreamResourceInfo.cs
- WhitespaceRule.cs
- FontStyleConverter.cs
- TokenBasedSetEnumerator.cs
- JumpList.cs
- DeferrableContentConverter.cs
- InstanceDataCollectionCollection.cs
- RecognitionEventArgs.cs
- ZipIORawDataFileBlock.cs
- Stack.cs
- DataGridView.cs
- HttpConfigurationContext.cs
- ReaderWriterLock.cs
- RawStylusInputCustomData.cs
- OutputCacheSettingsSection.cs
- CodeComment.cs
- DateTimePicker.cs
- CollaborationHelperFunctions.cs
- AssemblyAttributes.cs
- ResourceContainer.cs
- BuildProvider.cs
- DataGridTextBox.cs
- FieldTemplateFactory.cs
- Latin1Encoding.cs
- GPStream.cs
- RotateTransform.cs
- RuleSettingsCollection.cs
- BitVector32.cs
- Control.cs
- VarRemapper.cs
- EnvironmentPermission.cs
- DefaultHttpHandler.cs
- QualifiedCellIdBoolean.cs
- OwnerDrawPropertyBag.cs
- StatusBarAutomationPeer.cs
- CustomAssemblyResolver.cs
- PropertyMappingExceptionEventArgs.cs
- CommunicationObjectFaultedException.cs
- CommandPlan.cs
- COM2IDispatchConverter.cs
- FrugalMap.cs
- OdbcException.cs
- SessionPageStateSection.cs
- FieldBuilder.cs
- Compiler.cs
- CustomErrorsSection.cs
- ObjectDataSourceMethodEventArgs.cs
- WindowsContainer.cs
- TTSVoice.cs
- IPEndPoint.cs
- StylusPointDescription.cs
- CodeTypeReferenceCollection.cs
- HtmlInputImage.cs
- AssemblyAttributesGoHere.cs
- PaperSource.cs
- SmiEventSink_DeferedProcessing.cs
- ConsumerConnectionPoint.cs
- DependencyPropertyKey.cs
- ReadWriteSpinLock.cs
- XhtmlBasicLinkAdapter.cs
- ScriptDescriptor.cs
- FontStyles.cs
- JumpPath.cs
- DataServiceQueryOfT.cs
- ManifestBasedResourceGroveler.cs
- HeaderUtility.cs
- LifetimeServices.cs
- _SslState.cs
- DataFormats.cs
- TimerEventSubscription.cs
- DebugInfoExpression.cs
- ProviderBase.cs
- Transform3DGroup.cs
- ErrorEventArgs.cs
- RadioButton.cs
- FilteredAttributeCollection.cs
- CodeStatementCollection.cs
- IPAddressCollection.cs
- StrongNameUtility.cs
- BCryptHashAlgorithm.cs
- WmlTextBoxAdapter.cs
- ButtonStandardAdapter.cs
- sqlmetadatafactory.cs
- CmsInterop.cs
- DocumentOrderComparer.cs
- ConfigXmlAttribute.cs
- SubMenuStyle.cs
- Utilities.cs
- TextSegment.cs
- ControlLocalizer.cs
- ObjectMaterializedEventArgs.cs
- TransactionManager.cs
- NextPreviousPagerField.cs
- FullTextLine.cs
- CodeGenHelper.cs