Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / System / Windows / Threading / DispatcherProcessingDisabled.cs / 1305600 / DispatcherProcessingDisabled.cs
using System;
namespace System.Windows.Threading
{
///
/// A structure that allows for dispatcher processing to be
/// enabled after a call to Dispatcher.DisableProcessing.
///
public struct DispatcherProcessingDisabled : IDisposable
{
///
/// Reenable processing in the dispatcher.
///
public void Dispose()
{
if(_dispatcher != null)
{
_dispatcher.VerifyAccess();
_dispatcher._disableProcessingCount--;
_dispatcher = null;
}
}
///
/// Checks whether this object is equal to another
/// DispatcherProcessingDisabled object.
///
///
/// Object to compare with.
///
///
/// Returns true when the object is equal to the specified object,
/// and false otherwise.
///
public override bool Equals(object obj)
{
if ((null == obj) || !(obj is DispatcherProcessingDisabled))
return false;
return (this._dispatcher == ((DispatcherProcessingDisabled)obj)._dispatcher);
}
///
/// Compute hash code for this object.
///
/// A 32-bit signed integer hash code.
public override int GetHashCode( )
{
return base.GetHashCode();
}
///
/// Compare two DispatcherProcessingDisabled instances for equality.
///
///
/// left operand
///
///
/// right operand
///
///
/// Whether or not two operands are equal.
///
public static bool operator ==(DispatcherProcessingDisabled left, DispatcherProcessingDisabled right)
{
return left.Equals(right);
}
///
/// Compare two DispatcherProcessingDisabled instances for inequality.
///
///
/// left operand
///
///
/// right operand
///
///
/// Whether or not two operands are equal.
///
public static bool operator !=(DispatcherProcessingDisabled left, DispatcherProcessingDisabled right)
{
return !(left.Equals(right));
}
internal Dispatcher _dispatcher; // set by Dispatcher
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
using System;
namespace System.Windows.Threading
{
///
/// A structure that allows for dispatcher processing to be
/// enabled after a call to Dispatcher.DisableProcessing.
///
public struct DispatcherProcessingDisabled : IDisposable
{
///
/// Reenable processing in the dispatcher.
///
public void Dispose()
{
if(_dispatcher != null)
{
_dispatcher.VerifyAccess();
_dispatcher._disableProcessingCount--;
_dispatcher = null;
}
}
///
/// Checks whether this object is equal to another
/// DispatcherProcessingDisabled object.
///
///
/// Object to compare with.
///
///
/// Returns true when the object is equal to the specified object,
/// and false otherwise.
///
public override bool Equals(object obj)
{
if ((null == obj) || !(obj is DispatcherProcessingDisabled))
return false;
return (this._dispatcher == ((DispatcherProcessingDisabled)obj)._dispatcher);
}
///
/// Compute hash code for this object.
///
/// A 32-bit signed integer hash code.
public override int GetHashCode( )
{
return base.GetHashCode();
}
///
/// Compare two DispatcherProcessingDisabled instances for equality.
///
///
/// left operand
///
///
/// right operand
///
///
/// Whether or not two operands are equal.
///
public static bool operator ==(DispatcherProcessingDisabled left, DispatcherProcessingDisabled right)
{
return left.Equals(right);
}
///
/// Compare two DispatcherProcessingDisabled instances for inequality.
///
///
/// left operand
///
///
/// right operand
///
///
/// Whether or not two operands are equal.
///
public static bool operator !=(DispatcherProcessingDisabled left, DispatcherProcessingDisabled right)
{
return !(left.Equals(right));
}
internal Dispatcher _dispatcher; // set by Dispatcher
}
}
// 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
- Queue.cs
- DefinitionBase.cs
- Int32Rect.cs
- FormViewPagerRow.cs
- PointCollection.cs
- DecoderBestFitFallback.cs
- TabletDeviceInfo.cs
- DesignerAutoFormatStyle.cs
- documentsequencetextview.cs
- Soap12ServerProtocol.cs
- UnionCqlBlock.cs
- PassportAuthenticationModule.cs
- PropVariant.cs
- HttpModuleCollection.cs
- X509SecurityToken.cs
- Pkcs7Signer.cs
- SqlConnectionPoolGroupProviderInfo.cs
- RelationshipFixer.cs
- SqlTrackingService.cs
- ArithmeticException.cs
- UnsafeNativeMethods.cs
- SoapIgnoreAttribute.cs
- ProxyGenerationError.cs
- TransformGroup.cs
- MimeObjectFactory.cs
- CrossContextChannel.cs
- TableLayoutColumnStyleCollection.cs
- MailMessageEventArgs.cs
- DateTimeOffset.cs
- SerializableAttribute.cs
- ButtonField.cs
- TriState.cs
- DoubleAnimation.cs
- FontEmbeddingManager.cs
- RichTextBoxConstants.cs
- PngBitmapDecoder.cs
- brushes.cs
- WpfGeneratedKnownProperties.cs
- EventListener.cs
- ProviderIncompatibleException.cs
- XmlSchemaSubstitutionGroup.cs
- OutOfMemoryException.cs
- PropertyFilterAttribute.cs
- HtmlShimManager.cs
- BindingSourceDesigner.cs
- IconConverter.cs
- UpdateRecord.cs
- SoapDocumentMethodAttribute.cs
- PolyQuadraticBezierSegment.cs
- TitleStyle.cs
- BamlLocalizableResourceKey.cs
- GridViewColumnHeaderAutomationPeer.cs
- EdgeModeValidation.cs
- ChameleonKey.cs
- MeasureData.cs
- HScrollBar.cs
- ToolStripDropDownClosedEventArgs.cs
- HttpRequestCacheValidator.cs
- SmtpFailedRecipientException.cs
- ProcessProtocolHandler.cs
- SqlDataSourceRefreshSchemaForm.cs
- MarshalDirectiveException.cs
- Triangle.cs
- Unit.cs
- GiveFeedbackEvent.cs
- XmlSchemaAnyAttribute.cs
- OracleBoolean.cs
- X509CertificateClaimSet.cs
- MemberDescriptor.cs
- TcpHostedTransportConfiguration.cs
- DbParameterCollectionHelper.cs
- RowUpdatingEventArgs.cs
- DispatcherHookEventArgs.cs
- PreviewControlDesigner.cs
- ConnectionStringSettingsCollection.cs
- counter.cs
- ValueChangedEventManager.cs
- Options.cs
- Overlapped.cs
- WebFormDesignerActionService.cs
- EditingScopeUndoUnit.cs
- OperandQuery.cs
- XmlDigitalSignatureProcessor.cs
- CustomCategoryAttribute.cs
- ConsoleKeyInfo.cs
- ConfigurationSchemaErrors.cs
- Compiler.cs
- MemberRelationshipService.cs
- SamlAuthenticationStatement.cs
- ClaimComparer.cs
- PageHandlerFactory.cs
- SponsorHelper.cs
- WrappedIUnknown.cs
- IInstanceTable.cs
- AutoFocusStyle.xaml.cs
- CodeAccessSecurityEngine.cs
- X509CertificateEndpointIdentity.cs
- AspNetSynchronizationContext.cs
- ConfigurationStrings.cs
- XmlSerializerNamespaces.cs