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
- CompiledXpathExpr.cs
- OdbcDataAdapter.cs
- GraphicsState.cs
- BinaryReader.cs
- DataColumnMappingCollection.cs
- Propagator.JoinPropagator.cs
- TempEnvironment.cs
- PerformanceCounterManager.cs
- RenderDataDrawingContext.cs
- RefType.cs
- EmbeddedMailObject.cs
- QilFactory.cs
- ConfigPathUtility.cs
- SystemPens.cs
- ExpressionPrefixAttribute.cs
- TagMapCollection.cs
- TypeViewSchema.cs
- AnnotationHighlightLayer.cs
- CultureTable.cs
- Shape.cs
- HttpCacheVary.cs
- ElapsedEventArgs.cs
- ProfilePropertySettingsCollection.cs
- CookielessHelper.cs
- InstanceDataCollection.cs
- ClientType.cs
- PropertyValueUIItem.cs
- CacheEntry.cs
- Content.cs
- SqlWriter.cs
- PropertyKey.cs
- Imaging.cs
- ErrorTableItemStyle.cs
- TearOffProxy.cs
- ImpersonationContext.cs
- RemotingSurrogateSelector.cs
- CompModHelpers.cs
- ClaimTypeElement.cs
- XmlDocumentFragment.cs
- DocumentPageViewAutomationPeer.cs
- MemberAccessException.cs
- XPathDocumentBuilder.cs
- versioninfo.cs
- DataObjectMethodAttribute.cs
- TrackingRecord.cs
- CodeDirectoryCompiler.cs
- XmlException.cs
- XmlQueryContext.cs
- RtType.cs
- SimpleTextLine.cs
- DateTimePicker.cs
- GetPageNumberCompletedEventArgs.cs
- EntityConnection.cs
- TemplateBamlRecordReader.cs
- DataGridViewRowConverter.cs
- IssuedTokenParametersEndpointAddressElement.cs
- EventProvider.cs
- TableCellAutomationPeer.cs
- DynamicILGenerator.cs
- XPathArrayIterator.cs
- FileSystemInfo.cs
- ObjectParameter.cs
- ArrangedElementCollection.cs
- EventLogLink.cs
- Calendar.cs
- DispatcherExceptionFilterEventArgs.cs
- RawStylusActions.cs
- UnitySerializationHolder.cs
- FunctionDescription.cs
- followingsibling.cs
- EdmComplexPropertyAttribute.cs
- Thread.cs
- TypedColumnHandler.cs
- _UriTypeConverter.cs
- FacetChecker.cs
- MimeTypeAttribute.cs
- HostedElements.cs
- PkcsUtils.cs
- ProviderIncompatibleException.cs
- ConditionalAttribute.cs
- IERequestCache.cs
- StateManagedCollection.cs
- TransformGroup.cs
- AmbientProperties.cs
- UnsafeNetInfoNativeMethods.cs
- BlurBitmapEffect.cs
- GeometryCombineModeValidation.cs
- SqlDataReader.cs
- TrackingMemoryStream.cs
- ValidatingReaderNodeData.cs
- DataGridViewRowsRemovedEventArgs.cs
- XmlSchemaSubstitutionGroup.cs
- DynamicMetaObject.cs
- TableItemProviderWrapper.cs
- PropertyOverridesDialog.cs
- Activator.cs
- RegexCode.cs
- SerializerProvider.cs
- SqlRetyper.cs
- DbConnectionHelper.cs