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
- AnnotationMap.cs
- WebPartsSection.cs
- TargetException.cs
- ExpressionServices.cs
- UpDownEvent.cs
- CompiledRegexRunner.cs
- Models.cs
- ConfigPathUtility.cs
- SystemInformation.cs
- ConfigsHelper.cs
- ResourceExpressionEditorSheet.cs
- SqlDataSource.cs
- DataGridViewAccessibleObject.cs
- KnownBoxes.cs
- XmlNamespaceManager.cs
- ProcessRequestArgs.cs
- WebPartAddingEventArgs.cs
- PageAdapter.cs
- Message.cs
- TriggerActionCollection.cs
- InputLanguageCollection.cs
- EditorPartCollection.cs
- VideoDrawing.cs
- MemberProjectionIndex.cs
- OrderPreservingSpoolingTask.cs
- ForeignConstraint.cs
- FileDialogCustomPlace.cs
- TemplateContainer.cs
- MenuEventArgs.cs
- EmptyStringExpandableObjectConverter.cs
- ProgressBarHighlightConverter.cs
- FontNamesConverter.cs
- TiffBitmapEncoder.cs
- PageBreakRecord.cs
- ReachDocumentPageSerializerAsync.cs
- SerializerDescriptor.cs
- OneOfTypeConst.cs
- SafeCryptoKeyHandle.cs
- QueryResults.cs
- NamespaceDecl.cs
- FixedPageStructure.cs
- SafeArrayRankMismatchException.cs
- ColorConverter.cs
- KnownBoxes.cs
- ColorDialog.cs
- EntityContainerRelationshipSet.cs
- ExpressionBuilderContext.cs
- SplayTreeNode.cs
- ToolStripGripRenderEventArgs.cs
- FragmentQueryKB.cs
- DataGridViewHeaderCell.cs
- newinstructionaction.cs
- BooleanFacetDescriptionElement.cs
- ParameterBinding.cs
- WindowsScroll.cs
- URIFormatException.cs
- GeometryConverter.cs
- CultureInfo.cs
- UInt64.cs
- ModelItemImpl.cs
- RegexCharClass.cs
- DictionaryEntry.cs
- ConfigurationUtility.cs
- Vector.cs
- HttpRuntime.cs
- _TLSstream.cs
- ImageListUtils.cs
- ObjectDataSourceSelectingEventArgs.cs
- codemethodreferenceexpression.cs
- Point4D.cs
- StandardOleMarshalObject.cs
- DesignTimeTemplateParser.cs
- BlurBitmapEffect.cs
- SplitterEvent.cs
- InfoCard.cs
- HitTestParameters3D.cs
- ThicknessAnimationUsingKeyFrames.cs
- SourceFilter.cs
- GroupBoxRenderer.cs
- QualifiedCellIdBoolean.cs
- PropertyEmitter.cs
- WebConfigurationManager.cs
- XmlSchemaAttributeGroup.cs
- BitmapEffect.cs
- ListMarkerSourceInfo.cs
- LinqDataSourceValidationException.cs
- Roles.cs
- TextEditorSpelling.cs
- BuildResultCache.cs
- PropertyChangingEventArgs.cs
- CompModSwitches.cs
- ModelItemCollection.cs
- IdentityReference.cs
- FirewallWrapper.cs
- GridViewDeleteEventArgs.cs
- DoubleAnimationClockResource.cs
- AssemblyAttributesGoHere.cs
- PeekCompletedEventArgs.cs
- ServiceContractViewControl.Designer.cs
- BitmapEffectInput.cs