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
- SiteMapNodeItem.cs
- ReceiveContent.cs
- Logging.cs
- CssStyleCollection.cs
- Registry.cs
- InputLangChangeRequestEvent.cs
- RowParagraph.cs
- PromptStyle.cs
- Asn1IntegerConverter.cs
- TabletDevice.cs
- ApplicationSecurityManager.cs
- XmlAttributeAttribute.cs
- SourceFileBuildProvider.cs
- OletxDependentTransaction.cs
- COM2EnumConverter.cs
- HttpWriter.cs
- SecurityManager.cs
- FileDialogPermission.cs
- DataGridViewColumn.cs
- SecurityHelper.cs
- DataViewManager.cs
- processwaithandle.cs
- ObjectConverter.cs
- WorkflowServiceHostFactory.cs
- ContainerControl.cs
- InvalidDataException.cs
- QueueProcessor.cs
- TrustManagerPromptUI.cs
- SelectorAutomationPeer.cs
- InstanceHandleConflictException.cs
- FormParameter.cs
- RowUpdatingEventArgs.cs
- baseshape.cs
- TimelineClockCollection.cs
- ContentTextAutomationPeer.cs
- LinkedResourceCollection.cs
- ListViewPagedDataSource.cs
- EventRoute.cs
- NumberFormatInfo.cs
- TrustLevelCollection.cs
- TextSpan.cs
- PriorityRange.cs
- LiteralSubsegment.cs
- RoleGroupCollection.cs
- DbReferenceCollection.cs
- TargetFrameworkUtil.cs
- EnumUnknown.cs
- SnapLine.cs
- BoolLiteral.cs
- LogicalExpr.cs
- Pkcs7Recipient.cs
- DetailsViewAutoFormat.cs
- GridViewCellAutomationPeer.cs
- UrlMappingsModule.cs
- MarkupProperty.cs
- SamlAction.cs
- InternalTypeHelper.cs
- ExclusiveTcpListener.cs
- BindingExpressionUncommonField.cs
- ScrollBar.cs
- AttributeCollection.cs
- DockPanel.cs
- DateTimeSerializationSection.cs
- ImageUrlEditor.cs
- FrameworkRichTextComposition.cs
- SystemNetworkInterface.cs
- DbProviderFactoriesConfigurationHandler.cs
- ActivityDefaults.cs
- ServicesUtilities.cs
- Ipv6Element.cs
- BinaryFormatter.cs
- LogExtent.cs
- StringDictionary.cs
- RawStylusInput.cs
- MexTcpBindingElement.cs
- KeyValuePairs.cs
- TreeViewBindingsEditorForm.cs
- ApplicationDirectoryMembershipCondition.cs
- AccessDataSource.cs
- ObjectItemCollection.cs
- EntityDataSourceViewSchema.cs
- _AutoWebProxyScriptEngine.cs
- ICspAsymmetricAlgorithm.cs
- ProgramPublisher.cs
- Rect.cs
- WorkflowServiceOperationListItem.cs
- EdmFunctionAttribute.cs
- LinkLabel.cs
- EntityViewGenerationConstants.cs
- EntitySqlException.cs
- AllMembershipCondition.cs
- SecUtil.cs
- PropertyOverridesDialog.cs
- ArrayList.cs
- SQLByte.cs
- DoubleCollection.cs
- Translator.cs
- CornerRadius.cs
- CollectionConverter.cs
- TableLayout.cs