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
- Propagator.JoinPropagator.cs
- RequestQueue.cs
- BlurBitmapEffect.cs
- AutoGeneratedField.cs
- AuthorizationRuleCollection.cs
- ValueQuery.cs
- SerializationSectionGroup.cs
- WebPermission.cs
- MaskDescriptors.cs
- _Events.cs
- SrgsSubset.cs
- DataGridDesigner.cs
- XmlHierarchicalDataSourceView.cs
- AssociatedControlConverter.cs
- SelectedCellsChangedEventArgs.cs
- SymDocumentType.cs
- TextBoxBase.cs
- CacheHelper.cs
- UInt32.cs
- TextBoxBase.cs
- OracleString.cs
- UpDownEvent.cs
- CodeTypeReferenceCollection.cs
- FileUtil.cs
- BaseEntityWrapper.cs
- FormViewDeletedEventArgs.cs
- CodeValidator.cs
- OrderByBuilder.cs
- sqlpipe.cs
- DeobfuscatingStream.cs
- BmpBitmapDecoder.cs
- XmlSchemaInclude.cs
- PropertiesTab.cs
- UnmanagedMarshal.cs
- Delay.cs
- FontStretches.cs
- ViewStateException.cs
- ObjectListSelectEventArgs.cs
- RowsCopiedEventArgs.cs
- ImageAttributes.cs
- SqlRowUpdatedEvent.cs
- BinaryObjectInfo.cs
- LoginCancelEventArgs.cs
- ColumnPropertiesGroup.cs
- Attributes.cs
- XmlSerializationReader.cs
- IOException.cs
- CompilerScopeManager.cs
- AttributeSetAction.cs
- WriteLineDesigner.xaml.cs
- SqlRowUpdatingEvent.cs
- XmlILStorageConverter.cs
- NgenServicingAttributes.cs
- RichTextBox.cs
- GroupByQueryOperator.cs
- TextBoxAutomationPeer.cs
- MetadataItemEmitter.cs
- JsonWriter.cs
- ComponentSerializationService.cs
- CssClassPropertyAttribute.cs
- SafeIUnknown.cs
- DataGridViewCheckBoxCell.cs
- StandardBindingOptionalReliableSessionElement.cs
- ForAllOperator.cs
- OdbcConnection.cs
- XmlArrayAttribute.cs
- Point3DAnimation.cs
- ListViewItemMouseHoverEvent.cs
- ThreadStateException.cs
- WorkflowRuntimeServicesBehavior.cs
- ObjectHelper.cs
- ProxySimple.cs
- SocketInformation.cs
- SqlProvider.cs
- Help.cs
- OutOfProcStateClientManager.cs
- SizeFConverter.cs
- TraceFilter.cs
- DataBindingsDialog.cs
- WmlImageAdapter.cs
- XmlAnyAttributeAttribute.cs
- TraceListeners.cs
- EdmScalarPropertyAttribute.cs
- DataGridColumnHeadersPresenter.cs
- Win32.cs
- TemplateBamlTreeBuilder.cs
- InstanceDescriptor.cs
- SystemInfo.cs
- XmlAttributeCache.cs
- XmlHelper.cs
- WebUtil.cs
- DataListItemEventArgs.cs
- NumericPagerField.cs
- StylusPointPropertyInfoDefaults.cs
- DataGridHelper.cs
- RolePrincipal.cs
- PagesSection.cs
- XmlSignatureManifest.cs
- XPathNavigatorReader.cs
- HideDisabledControlAdapter.cs