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
- TraceData.cs
- GZipDecoder.cs
- ValueQuery.cs
- RestClientProxyHandler.cs
- BindingManagerDataErrorEventArgs.cs
- InputScopeNameConverter.cs
- AsmxEndpointPickerExtension.cs
- PointCollectionConverter.cs
- ModuleElement.cs
- XamlTreeBuilderBamlRecordWriter.cs
- PriorityChain.cs
- GeometryConverter.cs
- ListComponentEditor.cs
- UnmanagedHandle.cs
- RestClientProxyHandler.cs
- SafeNativeMethods.cs
- ADMembershipProvider.cs
- BamlMapTable.cs
- URLMembershipCondition.cs
- FrameworkElementFactory.cs
- ToolStripMenuItemCodeDomSerializer.cs
- SoapCodeExporter.cs
- WCFBuildProvider.cs
- DataGridViewCellParsingEventArgs.cs
- UriTemplatePathPartiallyEquivalentSet.cs
- ConnectionManagementElement.cs
- XmlQueryOutput.cs
- ComPlusServiceHost.cs
- XmlCustomFormatter.cs
- SkipQueryOptionExpression.cs
- KeyToListMap.cs
- GridViewDeletedEventArgs.cs
- DesignerAutoFormatStyle.cs
- MenuScrollingVisibilityConverter.cs
- BaseValidator.cs
- TargetParameterCountException.cs
- JpegBitmapEncoder.cs
- XmlSchemaAny.cs
- SurrogateDataContract.cs
- ProjectionPathSegment.cs
- ProfileService.cs
- ObjectDataSource.cs
- ProxyManager.cs
- RadioButtonAutomationPeer.cs
- SystemDiagnosticsSection.cs
- InternalBufferManager.cs
- TableCellCollection.cs
- OraclePermission.cs
- CaseCqlBlock.cs
- List.cs
- RowVisual.cs
- ObjectCacheSettings.cs
- ZipIOExtraFieldElement.cs
- SchemaName.cs
- ScriptControlDescriptor.cs
- RepeaterItem.cs
- XmlCountingReader.cs
- SchemaType.cs
- Input.cs
- Odbc32.cs
- ParserStreamGeometryContext.cs
- DataGridViewEditingControlShowingEventArgs.cs
- TemplateBindingExtension.cs
- ContextDataSourceView.cs
- MaskedTextProvider.cs
- ListItemParagraph.cs
- SafeSerializationManager.cs
- DataGridHeadersVisibilityToVisibilityConverter.cs
- HtmlControl.cs
- LayoutEditorPart.cs
- XPathNodePointer.cs
- XmlSerializerFactory.cs
- DataGridAutomationPeer.cs
- GeometryGroup.cs
- TextSelection.cs
- documentation.cs
- Point3DKeyFrameCollection.cs
- X509SubjectKeyIdentifierClause.cs
- IndependentAnimationStorage.cs
- ProtocolViolationException.cs
- DataPagerFieldCommandEventArgs.cs
- WebBaseEventKeyComparer.cs
- SiteMapNode.cs
- DataGridViewCellStyleBuilderDialog.cs
- GridViewUpdatedEventArgs.cs
- WebControl.cs
- CircleHotSpot.cs
- ContentTypeSettingClientMessageFormatter.cs
- CodeTypeDeclaration.cs
- TableItemProviderWrapper.cs
- SerializeAbsoluteContext.cs
- XD.cs
- Part.cs
- XPathDocumentIterator.cs
- MessageQueueCriteria.cs
- CodeAccessPermission.cs
- Parallel.cs
- IntegerFacetDescriptionElement.cs
- EntityDataSourceUtil.cs
- BypassElementCollection.cs