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
- InfoCardCryptoHelper.cs
- FormsAuthenticationCredentials.cs
- ProgressiveCrcCalculatingStream.cs
- XmlSchemaSimpleTypeList.cs
- AdCreatedEventArgs.cs
- XmlValidatingReaderImpl.cs
- StreamInfo.cs
- SkinBuilder.cs
- BamlRecordWriter.cs
- ValueChangedEventManager.cs
- SyndicationDeserializer.cs
- DragEvent.cs
- ExcCanonicalXml.cs
- DodSequenceMerge.cs
- TextLineBreak.cs
- _SSPISessionCache.cs
- HTMLTextWriter.cs
- TiffBitmapEncoder.cs
- DataGridViewCellCollection.cs
- PerformanceCounter.cs
- ComponentConverter.cs
- WindowsGraphics2.cs
- DefaultAssemblyResolver.cs
- DocumentCollection.cs
- ProgressiveCrcCalculatingStream.cs
- ResponseStream.cs
- CqlGenerator.cs
- TogglePattern.cs
- PageAsyncTaskManager.cs
- DataGridViewImageCell.cs
- WinFormsUtils.cs
- SkewTransform.cs
- ReaderWriterLock.cs
- BulletDecorator.cs
- ChannelServices.cs
- SynchronizationLockException.cs
- Vector.cs
- unitconverter.cs
- MenuItemBinding.cs
- RepeatBehaviorConverter.cs
- ProbeMatchesMessageCD1.cs
- TrackingServices.cs
- FrugalMap.cs
- AppModelKnownContentFactory.cs
- StreamWriter.cs
- DragStartedEventArgs.cs
- ManualWorkflowSchedulerService.cs
- FontStyles.cs
- TemplateNameScope.cs
- ColumnMapTranslator.cs
- UTF32Encoding.cs
- InternalBufferOverflowException.cs
- WebPartRestoreVerb.cs
- EmptyControlCollection.cs
- QilFunction.cs
- ListBindingHelper.cs
- DoubleAnimation.cs
- SqlClientWrapperSmiStreamChars.cs
- EntryPointNotFoundException.cs
- Pair.cs
- ResourceManagerWrapper.cs
- X509CertificateCollection.cs
- BlurBitmapEffect.cs
- MappingItemCollection.cs
- WebPartsPersonalization.cs
- PiiTraceSource.cs
- DocumentEventArgs.cs
- DXD.cs
- DynamicPropertyReader.cs
- WindowsRebar.cs
- IIS7UserPrincipal.cs
- VersionConverter.cs
- WebEncodingValidatorAttribute.cs
- BinHexDecoder.cs
- EntityParameter.cs
- SqlAggregateChecker.cs
- MobileTemplatedControlDesigner.cs
- CheckableControlBaseAdapter.cs
- HeaderUtility.cs
- FtpWebResponse.cs
- EventQueueState.cs
- XamlFxTrace.cs
- AudienceUriMode.cs
- Calendar.cs
- CodeIdentifiers.cs
- RowType.cs
- CompleteWizardStep.cs
- PropertyInformationCollection.cs
- AnnotationComponentChooser.cs
- StringAttributeCollection.cs
- VoiceObjectToken.cs
- StorageComplexTypeMapping.cs
- TableLayoutPanelCellPosition.cs
- RsaSecurityToken.cs
- ToolStripItemRenderEventArgs.cs
- CategoryNameCollection.cs
- sortedlist.cs
- ScrollBar.cs
- CodeTypeReferenceSerializer.cs
- HttpValueCollection.cs