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
- TextBox.cs
- UrlMapping.cs
- cache.cs
- SerializationFieldInfo.cs
- DecimalConverter.cs
- SoapParser.cs
- MobileComponentEditorPage.cs
- MarkerProperties.cs
- PrintController.cs
- Menu.cs
- streamingZipPartStream.cs
- CookieParameter.cs
- BaseDataListActionList.cs
- DataGridAutoFormat.cs
- ColumnReorderedEventArgs.cs
- DockPatternIdentifiers.cs
- Trace.cs
- Ref.cs
- ArgumentOutOfRangeException.cs
- SecurityKeyUsage.cs
- StringConverter.cs
- FunctionNode.cs
- ThreadStateException.cs
- PlainXmlDeserializer.cs
- ServiceNameElementCollection.cs
- PagedDataSource.cs
- XamlReaderHelper.cs
- ToolStripItemClickedEventArgs.cs
- RunWorkerCompletedEventArgs.cs
- ToolStripDropDownItem.cs
- HtmlTableRowCollection.cs
- MatcherBuilder.cs
- ResourceAttributes.cs
- PropertyRecord.cs
- FilterEventArgs.cs
- DataSourceProvider.cs
- RelationshipManager.cs
- PermissionSetTriple.cs
- SQLBinary.cs
- COM2Enum.cs
- XhtmlBasicControlAdapter.cs
- CodeEventReferenceExpression.cs
- SqlFacetAttribute.cs
- ServiceConfigurationTraceRecord.cs
- SchemaImporterExtension.cs
- CustomErrorCollection.cs
- CodeDirectionExpression.cs
- ProvidePropertyAttribute.cs
- templategroup.cs
- TTSEvent.cs
- DatePickerAutomationPeer.cs
- VectorAnimationUsingKeyFrames.cs
- HttpSessionStateWrapper.cs
- DataTemplateKey.cs
- AnimationStorage.cs
- DataListDesigner.cs
- BCryptHashAlgorithm.cs
- MetadataCollection.cs
- SystemException.cs
- BackgroundWorker.cs
- MessageSecurityOverHttpElement.cs
- XmlAttributeOverrides.cs
- QilSortKey.cs
- MetadataCollection.cs
- Pen.cs
- SqlDataSourceParameterParser.cs
- MultiPartWriter.cs
- Attachment.cs
- XamlTypeMapper.cs
- embossbitmapeffect.cs
- CodeGeneratorAttribute.cs
- ExpandCollapsePattern.cs
- CharacterString.cs
- NodeFunctions.cs
- SuppressMessageAttribute.cs
- DataBindingExpressionBuilder.cs
- SelectedDatesCollection.cs
- JsonEncodingStreamWrapper.cs
- XpsSerializerWriter.cs
- Roles.cs
- ApplicationActivator.cs
- StsCommunicationException.cs
- FileClassifier.cs
- MarshalByValueComponent.cs
- ListViewItemCollectionEditor.cs
- DbConnectionPoolCounters.cs
- SqlTypesSchemaImporter.cs
- RowsCopiedEventArgs.cs
- SmtpSection.cs
- DynamicUpdateCommand.cs
- UnsafeNativeMethodsCLR.cs
- SingleBodyParameterMessageFormatter.cs
- OleDbConnectionInternal.cs
- QueryableFilterRepeater.cs
- DesignerActionMethodItem.cs
- PropertyTabChangedEvent.cs
- PageWrapper.cs
- RequestResizeEvent.cs
- CompilerGeneratedAttribute.cs
- ButtonFieldBase.cs