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; NullablestartTime; [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
- ZoneMembershipCondition.cs
- PagesChangedEventArgs.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- CheckBox.cs
- CheckableControlBaseAdapter.cs
- FrameworkContextData.cs
- ToolStripDesignerUtils.cs
- CodeDefaultValueExpression.cs
- OpCodes.cs
- SmtpNetworkElement.cs
- ExclusiveCanonicalizationTransform.cs
- HttpPostClientProtocol.cs
- FileInfo.cs
- SystemGatewayIPAddressInformation.cs
- ActiveXHelper.cs
- ManagementEventArgs.cs
- PixelFormatConverter.cs
- TimeEnumHelper.cs
- XmlCharCheckingWriter.cs
- AsyncSerializedWorker.cs
- Timer.cs
- IconEditor.cs
- XmlDictionaryReaderQuotas.cs
- AuthorizationRule.cs
- UrlSyndicationContent.cs
- XmlSchemaInfo.cs
- NonVisualControlAttribute.cs
- InvariantComparer.cs
- DisposableCollectionWrapper.cs
- Point3DCollectionConverter.cs
- DataGridViewCellValueEventArgs.cs
- UnaryExpression.cs
- DeferredReference.cs
- TypeSource.cs
- input.cs
- OperationPickerDialog.cs
- ControlPersister.cs
- AttributeConverter.cs
- WebColorConverter.cs
- AuthorizationRule.cs
- ResourceContainer.cs
- Debug.cs
- FileDialog_Vista.cs
- ConnectionStringsSection.cs
- NetworkInterface.cs
- SafeNativeMethods.cs
- XmlHierarchicalEnumerable.cs
- ListControlStringCollectionEditor.cs
- DbQueryCommandTree.cs
- SamlSubject.cs
- _NestedMultipleAsyncResult.cs
- SizeAnimationClockResource.cs
- HttpVersion.cs
- Style.cs
- ObjectDataSourceMethodEventArgs.cs
- IFlowDocumentViewer.cs
- DataGridViewColumnCollection.cs
- DataServiceStreamResponse.cs
- PeerCollaboration.cs
- SizeFConverter.cs
- AliasedSlot.cs
- Utils.cs
- XsltContext.cs
- ResourcePermissionBaseEntry.cs
- UnmanagedMarshal.cs
- ContextDataSource.cs
- Int16Storage.cs
- BaseComponentEditor.cs
- TemplateInstanceAttribute.cs
- GridViewCommandEventArgs.cs
- GlyphingCache.cs
- Types.cs
- HelpHtmlBuilder.cs
- PipelineComponent.cs
- VirtualDirectoryMappingCollection.cs
- MetadataPropertyAttribute.cs
- StylusPlugInCollection.cs
- SchemaElementLookUpTableEnumerator.cs
- NumberFormatter.cs
- InstancePersistenceException.cs
- XPathException.cs
- ListViewSelectEventArgs.cs
- InputLanguageManager.cs
- OleDbEnumerator.cs
- UserInitiatedNavigationPermission.cs
- PageAdapter.cs
- XmlDocumentViewSchema.cs
- PageCache.cs
- PropertySet.cs
- FloaterBaseParagraph.cs
- NullableDecimalMinMaxAggregationOperator.cs
- SrgsElementFactoryCompiler.cs
- AvtEvent.cs
- StructuredTypeInfo.cs
- HtmlValidationSummaryAdapter.cs
- QueryReaderSettings.cs
- HMACSHA1.cs
- Grid.cs
- OracleFactory.cs
- DataBindingHandlerAttribute.cs