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
- DoubleLinkList.cs
- ContentIterators.cs
- StorageMappingFragment.cs
- LockRecoveryTask.cs
- DataControlPagerLinkButton.cs
- XmlWrappingReader.cs
- errorpatternmatcher.cs
- UIElement3D.cs
- ConstraintEnumerator.cs
- InputProcessorProfilesLoader.cs
- WCFBuildProvider.cs
- dataobject.cs
- XmlSchemaAttributeGroupRef.cs
- Comparer.cs
- sitestring.cs
- JsonFormatWriterGenerator.cs
- SetterBaseCollection.cs
- WebBrowserContainer.cs
- WebPartZoneCollection.cs
- MsmqBindingMonitor.cs
- DbConnectionInternal.cs
- DataSourceDesigner.cs
- DBBindings.cs
- DetailsViewPagerRow.cs
- RepeaterItemEventArgs.cs
- PathGeometry.cs
- ObjectConverter.cs
- BindingOperations.cs
- FilteredAttributeCollection.cs
- ResourceDescriptionAttribute.cs
- MachineSettingsSection.cs
- ReadOnlyDataSourceView.cs
- CodeTypeDelegate.cs
- SqlAliaser.cs
- DynamicPropertyHolder.cs
- PrimitiveList.cs
- SafeNativeMethodsOther.cs
- RTLAwareMessageBox.cs
- RedistVersionInfo.cs
- WebConfigurationFileMap.cs
- ImportCatalogPart.cs
- WebControlToolBoxItem.cs
- SafeWaitHandle.cs
- Internal.cs
- connectionpool.cs
- StructuralType.cs
- IndentedWriter.cs
- StringUtil.cs
- PasswordPropertyTextAttribute.cs
- ProjectionPathSegment.cs
- CodeIdentifiers.cs
- DeclarationUpdate.cs
- SqlDependencyListener.cs
- SafeNativeMethods.cs
- XamlTreeBuilderBamlRecordWriter.cs
- BulletedListEventArgs.cs
- RoleManagerModule.cs
- BindingMAnagerBase.cs
- WebPartCancelEventArgs.cs
- QueryConverter.cs
- TimeManager.cs
- Rotation3DAnimation.cs
- ControlCollection.cs
- TokenBasedSetEnumerator.cs
- DrawToolTipEventArgs.cs
- EastAsianLunisolarCalendar.cs
- CompiledELinqQueryState.cs
- Encoder.cs
- SingleKeyFrameCollection.cs
- FontStretchConverter.cs
- BamlResourceSerializer.cs
- CatalogPart.cs
- OutKeywords.cs
- SetIterators.cs
- DocumentViewerBase.cs
- LocatorManager.cs
- MetafileHeaderWmf.cs
- SecurityDescriptor.cs
- GridEntry.cs
- StringConverter.cs
- ProgressBarBrushConverter.cs
- RectKeyFrameCollection.cs
- SqlWebEventProvider.cs
- TextRangeEdit.cs
- InnerItemCollectionView.cs
- COM2FontConverter.cs
- DataSourceGeneratorException.cs
- DrawItemEvent.cs
- CultureSpecificCharacterBufferRange.cs
- SharedTcpTransportManager.cs
- QuaternionConverter.cs
- TypeReference.cs
- FreeFormDesigner.cs
- CalendarAutoFormat.cs
- DbConnectionHelper.cs
- RawStylusInputReport.cs
- SqlFacetAttribute.cs
- SqlParameter.cs
- SslStream.cs
- ChangeBlockUndoRecord.cs