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
- DynamicMetaObject.cs
- HtmlHead.cs
- SQLConvert.cs
- CreateUserWizardDesigner.cs
- DeviceContext2.cs
- RowToFieldTransformer.cs
- ReflectionServiceProvider.cs
- ApplicationInfo.cs
- ConnectorSelectionGlyph.cs
- StringCollection.cs
- Attachment.cs
- SortExpressionBuilder.cs
- DesignTimeSiteMapProvider.cs
- BooleanExpr.cs
- CompositeCollectionView.cs
- VectorValueSerializer.cs
- StylusPointPropertyInfo.cs
- FixedSOMGroup.cs
- OutOfProcStateClientManager.cs
- TextTreeTextNode.cs
- XPathSelectionIterator.cs
- ConsumerConnectionPointCollection.cs
- SecurityIdentifierConverter.cs
- DataSourceXmlClassAttribute.cs
- CapabilitiesAssignment.cs
- QueryContinueDragEvent.cs
- PreApplicationStartMethodAttribute.cs
- PropertySourceInfo.cs
- ItemTypeToolStripMenuItem.cs
- OdbcError.cs
- CodeNamespaceCollection.cs
- XmlBinaryReader.cs
- ModelTreeEnumerator.cs
- OdbcHandle.cs
- MLangCodePageEncoding.cs
- TableRowCollection.cs
- DataGridClipboardCellContent.cs
- ColorKeyFrameCollection.cs
- RawStylusInputCustomData.cs
- SafeNativeMethods.cs
- TemplateControlCodeDomTreeGenerator.cs
- HttpException.cs
- TileModeValidation.cs
- DataGridViewLinkCell.cs
- EventSourceCreationData.cs
- SqlDataSourceQueryEditor.cs
- LinqDataSourceHelper.cs
- AnchorEditor.cs
- UICuesEvent.cs
- Int16AnimationBase.cs
- NotImplementedException.cs
- HtmlInputButton.cs
- DataGridViewCellStateChangedEventArgs.cs
- SiteOfOriginContainer.cs
- OracleCommand.cs
- AsyncCodeActivityContext.cs
- XmlSchemaComplexContentExtension.cs
- ThumbAutomationPeer.cs
- DbExpressionVisitor_TResultType.cs
- ProtocolsConfigurationHandler.cs
- DropDownHolder.cs
- XmlComplianceUtil.cs
- UrlPath.cs
- COAUTHINFO.cs
- SqlDataSourceCommandEventArgs.cs
- BaseTemplateCodeDomTreeGenerator.cs
- FeatureSupport.cs
- FileLogRecordEnumerator.cs
- AttachInfo.cs
- RelationshipWrapper.cs
- ProviderIncompatibleException.cs
- DiscoveryDocumentReference.cs
- HttpRequestCacheValidator.cs
- InternalControlCollection.cs
- TableFieldsEditor.cs
- BatchParser.cs
- FixedLineResult.cs
- CorrelationKeyCalculator.cs
- BrowserCapabilitiesCodeGenerator.cs
- TextEffect.cs
- StateManagedCollection.cs
- CommonDialog.cs
- dataobject.cs
- ValueQuery.cs
- DispatchWrapper.cs
- WorkflowClientDeliverMessageWrapper.cs
- ExpressionReplacer.cs
- UpdatePanelTrigger.cs
- HashMembershipCondition.cs
- ListCollectionView.cs
- PeerEndPoint.cs
- ImageCodecInfoPrivate.cs
- NCryptNative.cs
- HostedElements.cs
- TraceLevelStore.cs
- RefType.cs
- DeploymentSectionCache.cs
- Int16Animation.cs
- KeyInterop.cs
- ResourceSet.cs