Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ComponentChangedEvent.cs
- CodeBinaryOperatorExpression.cs
- CodeGenerator.cs
- DriveInfo.cs
- SafeMemoryMappedFileHandle.cs
- GeometryGroup.cs
- HostedBindingBehavior.cs
- RtfFormatStack.cs
- Int32CollectionValueSerializer.cs
- HttpWebRequestElement.cs
- IProducerConsumerCollection.cs
- RequestCacheEntry.cs
- TraceUtility.cs
- LineServicesCallbacks.cs
- CategoryValueConverter.cs
- _NestedSingleAsyncResult.cs
- BitmapEffectDrawingContent.cs
- TextEditorCharacters.cs
- FormsAuthenticationUserCollection.cs
- NamespaceExpr.cs
- SignHashRequest.cs
- SqlBuilder.cs
- MessagePropertyDescription.cs
- ProjectionPruner.cs
- SynchronizedRandom.cs
- InputLanguageManager.cs
- PopupEventArgs.cs
- TextRunCache.cs
- Nodes.cs
- RsaSecurityTokenParameters.cs
- DataList.cs
- SqlDataSourceSelectingEventArgs.cs
- FontStretches.cs
- ConditionValidator.cs
- _NetworkingPerfCounters.cs
- PtsContext.cs
- VerticalAlignConverter.cs
- SiteMapPath.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- StringDictionary.cs
- BuilderPropertyEntry.cs
- DataControlImageButton.cs
- DataGridViewSelectedCellCollection.cs
- BaseResourcesBuildProvider.cs
- ServiceNameElement.cs
- httpserverutility.cs
- RectangleF.cs
- DbFunctionCommandTree.cs
- CompilerResults.cs
- AutoGeneratedFieldProperties.cs
- BindingList.cs
- Convert.cs
- WebHostUnsafeNativeMethods.cs
- InfoCard.cs
- ContourSegment.cs
- Task.cs
- ValidationManager.cs
- NumericPagerField.cs
- MouseActionValueSerializer.cs
- ModelFunction.cs
- EllipseGeometry.cs
- HtmlTableRow.cs
- XmlNodeComparer.cs
- EntityContainerAssociationSetEnd.cs
- NullableDecimalAverageAggregationOperator.cs
- DatagridviewDisplayedBandsData.cs
- InputBinder.cs
- XmlSchemas.cs
- SharedDp.cs
- Hex.cs
- NullableLongMinMaxAggregationOperator.cs
- MonthCalendar.cs
- BinaryObjectReader.cs
- GeneralTransform3DGroup.cs
- CommentEmitter.cs
- DataTemplateSelector.cs
- MimeObjectFactory.cs
- XmlBoundElement.cs
- WebPartExportVerb.cs
- SynchronizationContext.cs
- DataObjectAttribute.cs
- CodeNamespaceImportCollection.cs
- AdRotator.cs
- StateWorkerRequest.cs
- COSERVERINFO.cs
- EncoderExceptionFallback.cs
- _PooledStream.cs
- SortDescription.cs
- ErrorInfoXmlDocument.cs
- QueryOutputWriter.cs
- ToolStripDropDownClosingEventArgs.cs
- PrivateFontCollection.cs
- FontConverter.cs
- NonDualMessageSecurityOverHttpElement.cs
- ResourceExpressionEditor.cs
- WebPartTransformerCollection.cs
- ToolStripContentPanelDesigner.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- LineServicesCallbacks.cs
- DataSourceCacheDurationConverter.cs