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
- ComboBox.cs
- ExplicitDiscriminatorMap.cs
- FilterException.cs
- FontInfo.cs
- AttachmentCollection.cs
- _HelperAsyncResults.cs
- ScriptingWebServicesSectionGroup.cs
- ProfileModule.cs
- JsonDeserializer.cs
- MatrixUtil.cs
- VolatileEnlistmentMultiplexing.cs
- ResetableIterator.cs
- WindowsSecurityTokenAuthenticator.cs
- DecodeHelper.cs
- ExceptionList.cs
- BookmarkWorkItem.cs
- Base64Encoding.cs
- WindowsListViewGroupHelper.cs
- Exception.cs
- UserMapPath.cs
- TypeConverterHelper.cs
- PrimitiveSchema.cs
- HtmlInputText.cs
- ServiceMetadataPublishingElement.cs
- EditorBrowsableAttribute.cs
- RegexWorker.cs
- IIS7UserPrincipal.cs
- ChannelTerminatedException.cs
- Storyboard.cs
- SimpleBitVector32.cs
- PipelineDeploymentState.cs
- TreeNode.cs
- GacUtil.cs
- MarkupObject.cs
- AdRotator.cs
- _ConnectionGroup.cs
- FunctionImportMapping.cs
- ToolStripSystemRenderer.cs
- DBSqlParserColumnCollection.cs
- ConfigXmlWhitespace.cs
- DesignerCategoryAttribute.cs
- COM2Properties.cs
- HtmlEmptyTagControlBuilder.cs
- UIEndRequest.cs
- DescendantOverDescendantQuery.cs
- ISSmlParser.cs
- ExtensibleClassFactory.cs
- TextSchema.cs
- ProgressiveCrcCalculatingStream.cs
- DbCommandDefinition.cs
- Semaphore.cs
- StringBlob.cs
- InfiniteIntConverter.cs
- JsonWriter.cs
- Adorner.cs
- ProfileEventArgs.cs
- SecurityPolicySection.cs
- Decimal.cs
- SymbolDocumentInfo.cs
- AnnotationMap.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- ComponentEditorForm.cs
- CountAggregationOperator.cs
- ListView.cs
- EtwTrace.cs
- DPCustomTypeDescriptor.cs
- SessionPageStatePersister.cs
- LinearQuaternionKeyFrame.cs
- BufferModeSettings.cs
- InfoCardRSACryptoProvider.cs
- CodeTypeDeclaration.cs
- DataReaderContainer.cs
- XamlStackWriter.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- AuthenticationModulesSection.cs
- CapabilitiesState.cs
- GregorianCalendarHelper.cs
- Profiler.cs
- ClaimComparer.cs
- SerializationStore.cs
- InputLanguage.cs
- Label.cs
- TemplateKey.cs
- Helpers.cs
- FixedTextSelectionProcessor.cs
- cryptoapiTransform.cs
- DisableDpiAwarenessAttribute.cs
- UnmanagedHandle.cs
- AtomEntry.cs
- HMACSHA384.cs
- DataPager.cs
- WebPartTransformer.cs
- Wildcard.cs
- StateDesigner.LayoutSelectionGlyph.cs
- CollectionViewGroupInternal.cs
- HistoryEventArgs.cs
- FileRecordSequenceCompletedAsyncResult.cs
- TemplateControlCodeDomTreeGenerator.cs
- ObjectSecurity.cs
- UnsafeNativeMethods.cs