Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Base / System / Windows / Threading / DispatcherProcessingDisabled.cs / 1 / 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
- QilTargetType.cs
- TraceInternal.cs
- ProcessHostFactoryHelper.cs
- ContainerActivationHelper.cs
- ManagedIStream.cs
- NullableBoolConverter.cs
- BorderGapMaskConverter.cs
- FileController.cs
- GenericsNotImplementedException.cs
- CacheAxisQuery.cs
- InternalEnumValidator.cs
- BrowserDefinitionCollection.cs
- CodeCommentStatementCollection.cs
- FixedSOMGroup.cs
- ExpressionPrefixAttribute.cs
- UnsignedPublishLicense.cs
- ResourceContainer.cs
- StringResourceManager.cs
- FrugalList.cs
- OperationValidationEventArgs.cs
- columnmapfactory.cs
- Match.cs
- DesignerWidgets.cs
- SecureStringHasher.cs
- ListViewDeletedEventArgs.cs
- XmlUtil.cs
- DisplayInformation.cs
- PageCodeDomTreeGenerator.cs
- WebPartCatalogCloseVerb.cs
- UserControlCodeDomTreeGenerator.cs
- AutomationElementIdentifiers.cs
- FullTextBreakpoint.cs
- IChannel.cs
- TextParagraph.cs
- ClientBuildManagerCallback.cs
- AsyncDataRequest.cs
- clipboard.cs
- ProxySimple.cs
- DrawingAttributeSerializer.cs
- AuthenticationSection.cs
- X509ChainPolicy.cs
- ReflectionPermission.cs
- TypeSystemProvider.cs
- ExecutionScope.cs
- TemplateKey.cs
- ConfigurationManagerInternalFactory.cs
- BamlBinaryReader.cs
- TreeNodeCollection.cs
- TextTreePropertyUndoUnit.cs
- BaseDataList.cs
- Currency.cs
- MetadataCacheItem.cs
- _AutoWebProxyScriptEngine.cs
- TimeZone.cs
- ColorConvertedBitmap.cs
- wgx_commands.cs
- KeyEventArgs.cs
- FolderNameEditor.cs
- SiteMapDataSourceView.cs
- BigIntegerStorage.cs
- ImageButton.cs
- DbProviderFactoriesConfigurationHandler.cs
- CallbackHandler.cs
- CngAlgorithm.cs
- PersistenceProvider.cs
- FakeModelPropertyImpl.cs
- Debugger.cs
- DesignerCategoryAttribute.cs
- RuleEngine.cs
- CryptographicAttribute.cs
- ToolStripGripRenderEventArgs.cs
- ObjectListComponentEditor.cs
- StructuredType.cs
- IDictionary.cs
- HttpHandlerActionCollection.cs
- Site.cs
- SetStoryboardSpeedRatio.cs
- ResXDataNode.cs
- CreationContext.cs
- SocketException.cs
- QilList.cs
- ScrollProperties.cs
- PropertyChangingEventArgs.cs
- EntityKey.cs
- ContextActivityUtils.cs
- SafeNativeMethods.cs
- PersonalizationStateInfoCollection.cs
- PopOutPanel.cs
- QualificationDataItem.cs
- PointConverter.cs
- DelegatingStream.cs
- listitem.cs
- NameValueCollection.cs
- SHA1CryptoServiceProvider.cs
- EmptyImpersonationContext.cs
- OutputCacheSettings.cs
- Subtree.cs
- WebPartTracker.cs
- GeneratedView.cs
- WindowsProgressbar.cs