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
- GroupBox.cs
- BinaryMessageFormatter.cs
- XmlChildEnumerator.cs
- ElementMarkupObject.cs
- BmpBitmapDecoder.cs
- WCFBuildProvider.cs
- ActivityScheduledQuery.cs
- SystemColors.cs
- SafeEventHandle.cs
- ProtocolsSection.cs
- RtfControlWordInfo.cs
- RepeaterDesigner.cs
- FontSizeConverter.cs
- DataGridViewLayoutData.cs
- SeparatorAutomationPeer.cs
- SettingsPropertyValueCollection.cs
- FamilyCollection.cs
- WindowsListViewSubItem.cs
- ObjectDataSourceDisposingEventArgs.cs
- OperatorExpressions.cs
- EdmSchemaError.cs
- PerformanceCounterPermissionEntry.cs
- AsyncPostBackErrorEventArgs.cs
- PersonalizationProviderHelper.cs
- GenericsNotImplementedException.cs
- ProcessHostConfigUtils.cs
- CounterCreationDataCollection.cs
- HttpRequestMessageProperty.cs
- SelectionEditor.cs
- SafeReadContext.cs
- ListItemParagraph.cs
- SaveLedgerEntryRequest.cs
- LinqDataSourceDisposeEventArgs.cs
- NotifyIcon.cs
- FullTrustAssemblyCollection.cs
- SqlBulkCopyColumnMappingCollection.cs
- ModuleBuilder.cs
- StrokeDescriptor.cs
- RenameRuleObjectDialog.cs
- AnonymousIdentificationModule.cs
- WindowsListViewSubItem.cs
- DesignerActionUIStateChangeEventArgs.cs
- DateTime.cs
- CompatibleIComparer.cs
- FaultContext.cs
- DataSourceNameHandler.cs
- ConfigurationStrings.cs
- InstanceDataCollection.cs
- ScrollProviderWrapper.cs
- DocumentSequenceHighlightLayer.cs
- Delay.cs
- InkSerializer.cs
- InstallerTypeAttribute.cs
- ParserExtension.cs
- DefaultPropertiesToSend.cs
- CollectionDataContractAttribute.cs
- XmlSchemaAttributeGroupRef.cs
- SvcMapFileLoader.cs
- Group.cs
- CompositeCollection.cs
- ContextItemManager.cs
- XmlAttributeProperties.cs
- DataAdapter.cs
- GlyphTypeface.cs
- ValueType.cs
- BaseParagraph.cs
- DiscriminatorMap.cs
- DataGridViewButtonColumn.cs
- DataSvcMapFile.cs
- OracleSqlParser.cs
- InkCanvas.cs
- UpdateTracker.cs
- PageSetupDialog.cs
- ResolveNameEventArgs.cs
- CollaborationHelperFunctions.cs
- InputEventArgs.cs
- TableHeaderCell.cs
- SystemTcpStatistics.cs
- BooleanProjectedSlot.cs
- WindowsSolidBrush.cs
- FileLogRecordStream.cs
- SecUtil.cs
- VariantWrapper.cs
- RuntimeResourceSet.cs
- MatrixStack.cs
- WebPartRestoreVerb.cs
- WebSysDisplayNameAttribute.cs
- BrowserInteropHelper.cs
- StrokeCollectionDefaultValueFactory.cs
- XPathBuilder.cs
- XPathNodeList.cs
- GlobalEventManager.cs
- DocumentApplication.cs
- MDIControlStrip.cs
- VBCodeProvider.cs
- EncryptedData.cs
- ApplicationHost.cs
- CheckBoxAutomationPeer.cs
- DropShadowEffect.cs
- Model3DGroup.cs