Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / MS / Internal / LoadedOrUnloadedOperation.cs / 1 / 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
- WebPartTransformerAttribute.cs
- BasePropertyDescriptor.cs
- CustomCredentialPolicy.cs
- EncoderFallback.cs
- GiveFeedbackEvent.cs
- Oci.cs
- AQNBuilder.cs
- SqlRecordBuffer.cs
- GridViewRowPresenter.cs
- NetCodeGroup.cs
- SecureConversationVersion.cs
- InvokePattern.cs
- StringFunctions.cs
- BaseCodeDomTreeGenerator.cs
- DataGridItemAutomationPeer.cs
- ConsoleCancelEventArgs.cs
- DependencyPropertyDescriptor.cs
- IdentityValidationException.cs
- CodePrimitiveExpression.cs
- SmtpNetworkElement.cs
- QuaternionValueSerializer.cs
- ClientConvert.cs
- EnumValAlphaComparer.cs
- HandledMouseEvent.cs
- IndexedString.cs
- StyleSheetRefUrlEditor.cs
- ObjectSet.cs
- IChannel.cs
- ReflectionHelper.cs
- RotateTransform.cs
- XmlIterators.cs
- PolyLineSegmentFigureLogic.cs
- HandleExceptionArgs.cs
- GPPOINTF.cs
- DataListItem.cs
- CommandID.cs
- WizardStepBase.cs
- DocumentScope.cs
- ListenerElementsCollection.cs
- IDispatchConstantAttribute.cs
- ResumeStoryboard.cs
- ValueQuery.cs
- OutputCacheProfile.cs
- Container.cs
- SimpleParser.cs
- MatrixAnimationUsingPath.cs
- recordstatefactory.cs
- SchemaMapping.cs
- PointLightBase.cs
- Converter.cs
- XmlSchemaCollection.cs
- DataGridViewCellStyle.cs
- FormatSettings.cs
- Win32Native.cs
- SqlMethodAttribute.cs
- GuidelineSet.cs
- StringArrayConverter.cs
- UnauthorizedWebPart.cs
- TriggerBase.cs
- PriorityQueue.cs
- RetrieveVirtualItemEventArgs.cs
- RoleManagerEventArgs.cs
- HttpRuntime.cs
- PrefixHandle.cs
- ValuePattern.cs
- LocatorGroup.cs
- LinearGradientBrush.cs
- MailDefinition.cs
- StateRuntime.cs
- MouseOverProperty.cs
- NamespaceCollection.cs
- VisualProxy.cs
- WorkflowDebuggerSteppingAttribute.cs
- TraceUtility.cs
- RuntimeCompatibilityAttribute.cs
- Knowncolors.cs
- unsafeIndexingFilterStream.cs
- ClientBuildManagerCallback.cs
- ComPlusTypeLoader.cs
- SerializationInfoEnumerator.cs
- PointCollection.cs
- MetaColumn.cs
- Converter.cs
- ScriptingScriptResourceHandlerSection.cs
- Application.cs
- SessionStateUtil.cs
- SoapSchemaExporter.cs
- DynamicILGenerator.cs
- BaseCAMarshaler.cs
- TemplateInstanceAttribute.cs
- PortCache.cs
- MarkupCompilePass1.cs
- XmlSchemaException.cs
- EntityTransaction.cs
- DataDesignUtil.cs
- SqlDataSourceSelectingEventArgs.cs
- ObjectStateFormatter.cs
- XmlElement.cs
- UdpDiscoveryEndpointElement.cs
- InlineUIContainer.cs