Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Discovery / System / ServiceModel / Discovery / AsyncOperationContext.cs / 1305376 / AsyncOperationContext.cs
//----------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------
namespace System.ServiceModel.Discovery
{
using System;
using System.ComponentModel;
using System.Runtime;
using System.Threading;
using System.Xml;
// WARNING: This object is not thread safe.
// Use SyncRoot to protect access to methods and properties as required.
abstract class AsyncOperationContext
{
AsyncOperation asyncOperation;
TimeSpan duration;
bool isCompleted;
int maxResults;
UniqueId operationId;
Nullable startTime;
[Fx.Tag.SynchronizationObject()]
object syncRoot;
IOThreadTimer timer;
object userState;
internal AsyncOperationContext(UniqueId operationId, int maxResults, TimeSpan duration, object userState)
{
Fx.Assert(operationId != null, "The operation id must be non null.");
Fx.Assert(maxResults > 0, "The maxResults parameter must be positive.");
Fx.Assert(duration > TimeSpan.Zero, "The duration parameter must be positive.");
this.maxResults = maxResults;
this.duration = duration;
this.userState = userState;
this.operationId = operationId;
this.syncRoot = new object();
}
public AsyncOperation AsyncOperation
{
get
{
return this.asyncOperation;
}
set
{
this.asyncOperation = value;
}
}
public TimeSpan Duration
{
get
{
return this.duration;
}
}
public bool IsCompleted
{
get
{
return this.isCompleted;
}
}
public bool IsSyncOperation
{
get
{
return (UserState is SyncOperationState);
}
}
public int MaxResults
{
get
{
return this.maxResults;
}
}
public UniqueId OperationId
{
get
{
return this.operationId;
}
}
public object SyncRoot
{
get
{
return syncRoot;
}
}
public object UserState
{
get
{
return this.userState;
}
}
public Nullable StartedAt
{
get
{
return this.startTime;
}
}
public void Complete()
{
this.StopTimer();
this.isCompleted = true;
}
public void StartTimer(Action
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WindowsRichEdit.cs
- XmlNode.cs
- IPipelineRuntime.cs
- ColorContextHelper.cs
- PackageProperties.cs
- NonBatchDirectoryCompiler.cs
- ExtensionMethods.cs
- CqlErrorHelper.cs
- MILUtilities.cs
- ImportCatalogPart.cs
- GenerateTemporaryTargetAssembly.cs
- SecurityProtocol.cs
- InsufficientMemoryException.cs
- ToolStripItemRenderEventArgs.cs
- ByteStack.cs
- XsltArgumentList.cs
- SessionEndedEventArgs.cs
- RequestSecurityToken.cs
- OleDbCommandBuilder.cs
- WebPart.cs
- x509utils.cs
- VBIdentifierTrimConverter.cs
- MaskDescriptor.cs
- OdbcReferenceCollection.cs
- DiscriminatorMap.cs
- ExtensionWindowResizeGrip.cs
- ControlCommandSet.cs
- EmptyQuery.cs
- HtmlInputHidden.cs
- Zone.cs
- BaseAsyncResult.cs
- LabelLiteral.cs
- Int32CAMarshaler.cs
- VectorKeyFrameCollection.cs
- UIElement3D.cs
- XmlDocumentFragment.cs
- XmlSchemaSearchPattern.cs
- KeyPullup.cs
- SchemaMerger.cs
- ServiceModelConfigurationSectionGroup.cs
- CompleteWizardStep.cs
- _Events.cs
- LinqDataSourceDisposeEventArgs.cs
- DataServices.cs
- XamlDesignerSerializationManager.cs
- HwndSubclass.cs
- ConnectivityStatus.cs
- AttachInfo.cs
- InputScopeNameConverter.cs
- SqlPersonalizationProvider.cs
- InternalSafeNativeMethods.cs
- DateTimeUtil.cs
- UmAlQuraCalendar.cs
- HtmlHead.cs
- XsdBuildProvider.cs
- CultureMapper.cs
- TabRenderer.cs
- CallbackException.cs
- AcceptorSessionSymmetricMessageSecurityProtocol.cs
- ContainerControl.cs
- ScaleTransform3D.cs
- TouchPoint.cs
- ResourceWriter.cs
- ResXResourceWriter.cs
- WebResponse.cs
- CallbackBehaviorAttribute.cs
- HelpProvider.cs
- FixedPageStructure.cs
- SerializationInfoEnumerator.cs
- WebPartChrome.cs
- Registry.cs
- RequestQueryParser.cs
- DCSafeHandle.cs
- BoundField.cs
- BlockCollection.cs
- ScriptMethodAttribute.cs
- AssemblyNameProxy.cs
- ExtensionQuery.cs
- DotExpr.cs
- SizeConverter.cs
- TrustSection.cs
- RegisteredDisposeScript.cs
- OdbcConnectionStringbuilder.cs
- SerialStream.cs
- FixedPosition.cs
- ListViewGroupConverter.cs
- SynchronizationContext.cs
- XmlNodeList.cs
- EmissiveMaterial.cs
- StoryFragments.cs
- IntegerCollectionEditor.cs
- assemblycache.cs
- SchemaImporterExtensionElement.cs
- DependencyObjectPropertyDescriptor.cs
- TextPointerBase.cs
- FilterQueryOptionExpression.cs
- FillRuleValidation.cs
- TextTreePropertyUndoUnit.cs
- MatrixKeyFrameCollection.cs
- DocumentGridContextMenu.cs