Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EntityCommand.cs
- ToolStripDesignerAvailabilityAttribute.cs
- PointKeyFrameCollection.cs
- ExtendedPropertyCollection.cs
- IntSecurity.cs
- DurationConverter.cs
- _ShellExpression.cs
- SharedPerformanceCounter.cs
- URLMembershipCondition.cs
- SplitterPanelDesigner.cs
- TemplateField.cs
- ServiceContractDetailViewControl.cs
- SqlClientPermission.cs
- WebPartPersonalization.cs
- TrustManagerMoreInformation.cs
- RSAOAEPKeyExchangeDeformatter.cs
- CategoryAttribute.cs
- TreeViewCancelEvent.cs
- OleDbPropertySetGuid.cs
- CrossAppDomainChannel.cs
- TextPatternIdentifiers.cs
- AdornerDecorator.cs
- OleDbException.cs
- LoginName.cs
- Pointer.cs
- Activity.cs
- Binding.cs
- PreservationFileReader.cs
- ScriptReferenceBase.cs
- DrawListViewColumnHeaderEventArgs.cs
- filewebrequest.cs
- ValidationError.cs
- CodeDesigner.cs
- ScrollData.cs
- QueryOutputWriterV1.cs
- hresults.cs
- ActiveXSerializer.cs
- ByValueEqualityComparer.cs
- FailedToStartupUIException.cs
- MethodBuilderInstantiation.cs
- oledbmetadatacolumnnames.cs
- TextEditor.cs
- BamlCollectionHolder.cs
- MouseActionValueSerializer.cs
- sqlser.cs
- ContainerParagraph.cs
- ProtocolsSection.cs
- ExtractorMetadata.cs
- WindowsMenu.cs
- NameNode.cs
- HScrollProperties.cs
- TableLayout.cs
- ApplicationFileCodeDomTreeGenerator.cs
- Token.cs
- CodeDomConfigurationHandler.cs
- RegexMatch.cs
- Size.cs
- IconBitmapDecoder.cs
- WebBrowser.cs
- Separator.cs
- ProgressBar.cs
- DataControlFieldCollection.cs
- XMLDiffLoader.cs
- DataGridViewCellPaintingEventArgs.cs
- PageThemeCodeDomTreeGenerator.cs
- SafeThreadHandle.cs
- XmlDocumentType.cs
- DesignerContextDescriptor.cs
- CreateUserWizardStep.cs
- PipelineModuleStepContainer.cs
- ISFClipboardData.cs
- QilCloneVisitor.cs
- DataGridViewCellStyle.cs
- EncoderNLS.cs
- DescendentsWalker.cs
- BindingCompleteEventArgs.cs
- LineSegment.cs
- DataGridTablesFactory.cs
- ToolStripDropDownClosedEventArgs.cs
- wgx_render.cs
- X509ChainPolicy.cs
- GridViewRowEventArgs.cs
- SerializationInfoEnumerator.cs
- TextWriter.cs
- KnownTypesHelper.cs
- RawMouseInputReport.cs
- VectorCollectionValueSerializer.cs
- ImageList.cs
- AccessDataSourceWizardForm.cs
- DataSourceComponent.cs
- ObjectDataSourceMethodEventArgs.cs
- ListCollectionView.cs
- validation.cs
- ItemCollection.cs
- StylusDownEventArgs.cs
- DataTable.cs
- SamlDoNotCacheCondition.cs
- RelatedImageListAttribute.cs
- PeerPresenceInfo.cs
- SID.cs