Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / MS / Internal / LoadedOrUnloadedOperation.cs / 1305600 / LoadedOrUnloadedOperation.cs
//------------------------------------------------------------------------------ // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // A pending loaded or unloaded operation, to be run by the MediaContext. // //----------------------------------------------------------------------------- using System; using System.Diagnostics; // Debug.Assert using System.Windows; // DependencyObject using System.Windows.Threading; // DispatcherOperationCallback using MS.Internal.PresentationCore; // [FriendAccessAllowed] namespace MS.Internal { [FriendAccessAllowed] // Built into Core, also used by Framework. internal class LoadedOrUnloadedOperation { internal LoadedOrUnloadedOperation( DispatcherOperationCallback callback, DependencyObject target) { Debug.Assert(callback != null && target != null); _callback = callback; _target = target; } internal void DoWork() { if (!_cancelled) { _callback(_target); } } internal void Cancel() { _cancelled = true; } private DispatcherOperationCallback _callback; private DependencyObject _target; private bool _cancelled; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // A pending loaded or unloaded operation, to be run by the MediaContext. // //----------------------------------------------------------------------------- using System; using System.Diagnostics; // Debug.Assert using System.Windows; // DependencyObject using System.Windows.Threading; // DispatcherOperationCallback using MS.Internal.PresentationCore; // [FriendAccessAllowed] namespace MS.Internal { [FriendAccessAllowed] // Built into Core, also used by Framework. internal class LoadedOrUnloadedOperation { internal LoadedOrUnloadedOperation( DispatcherOperationCallback callback, DependencyObject target) { Debug.Assert(callback != null && target != null); _callback = callback; _target = target; } internal void DoWork() { if (!_cancelled) { _callback(_target); } } internal void Cancel() { _cancelled = true; } private DispatcherOperationCallback _callback; private DependencyObject _target; private bool _cancelled; } } // 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
- DataGridColumnEventArgs.cs
- RTLAwareMessageBox.cs
- ConfigXmlAttribute.cs
- ErrorWrapper.cs
- GuidelineSet.cs
- DataGridPageChangedEventArgs.cs
- ModulesEntry.cs
- PrePrepareMethodAttribute.cs
- SchemaElementLookUpTable.cs
- CodeDirectiveCollection.cs
- CreateUserWizard.cs
- PowerModeChangedEventArgs.cs
- AttachmentCollection.cs
- CodeObjectCreateExpression.cs
- HwndStylusInputProvider.cs
- GridItemPattern.cs
- NameHandler.cs
- PaperSize.cs
- ProviderConnectionPointCollection.cs
- SingleConverter.cs
- UrlPropertyAttribute.cs
- EdmProviderManifest.cs
- Point4D.cs
- DynamicValidator.cs
- XmlNodeWriter.cs
- AutoGeneratedField.cs
- InputMethodStateChangeEventArgs.cs
- AnnotationService.cs
- RootBrowserWindowAutomationPeer.cs
- ParentUndoUnit.cs
- ScriptResourceDefinition.cs
- RequestQueryProcessor.cs
- HandledMouseEvent.cs
- ModelItemDictionaryImpl.cs
- UserMapPath.cs
- TemplateBaseAction.cs
- VectorConverter.cs
- TimeoutValidationAttribute.cs
- BindingOperations.cs
- PkcsMisc.cs
- WaitHandleCannotBeOpenedException.cs
- pingexception.cs
- EventMap.cs
- RoleManagerSection.cs
- ControlBuilder.cs
- StyleReferenceConverter.cs
- TabPage.cs
- ColorMatrix.cs
- RulePatternOps.cs
- ActivityCollectionMarkupSerializer.cs
- RightNameExpirationInfoPair.cs
- DirectionalLight.cs
- AnnotationAuthorChangedEventArgs.cs
- NotCondition.cs
- DataGridViewColumnStateChangedEventArgs.cs
- PropertyPathConverter.cs
- SpellerInterop.cs
- Char.cs
- XMLSchema.cs
- MetafileHeader.cs
- ToolStripManager.cs
- SiteMapDataSourceView.cs
- BitmapFrameDecode.cs
- TiffBitmapEncoder.cs
- PrinterResolution.cs
- TerminateDesigner.cs
- NaturalLanguageHyphenator.cs
- XpsSerializationManagerAsync.cs
- ScrollChangedEventArgs.cs
- WsatServiceAddress.cs
- UdpSocketReceiveManager.cs
- AmbientProperties.cs
- XamlFxTrace.cs
- ArgumentException.cs
- DataService.cs
- HandlerWithFactory.cs
- InputLanguageSource.cs
- EndpointReference.cs
- CqlParser.cs
- InvalidDocumentContentsException.cs
- MsmqIntegrationValidationBehavior.cs
- CultureInfoConverter.cs
- SQLByte.cs
- XmlSchemaNotation.cs
- OperationAbortedException.cs
- BufferedStream.cs
- Line.cs
- SamlSubject.cs
- Adorner.cs
- TimeSpanStorage.cs
- Decimal.cs
- SmtpClient.cs
- GPPOINTF.cs
- ValidatingReaderNodeData.cs
- XmlDigitalSignatureProcessor.cs
- TemplateControlBuildProvider.cs
- TypedColumnHandler.cs
- Constants.cs
- MarkupCompiler.cs
- SynchronizationLockException.cs