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
- LinkClickEvent.cs
- WebServiceResponse.cs
- Substitution.cs
- ApplicationContext.cs
- TreeViewItem.cs
- CommunicationObjectAbortedException.cs
- Compilation.cs
- ColumnMapVisitor.cs
- PeerFlooder.cs
- WinEventQueueItem.cs
- Currency.cs
- CodeMemberEvent.cs
- DataGridViewComponentPropertyGridSite.cs
- SamlDoNotCacheCondition.cs
- CodeDelegateCreateExpression.cs
- SetState.cs
- SkinBuilder.cs
- MissingSatelliteAssemblyException.cs
- RenderingBiasValidation.cs
- PageVisual.cs
- CreatingCookieEventArgs.cs
- WebBrowser.cs
- TableLayoutPanel.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- ConfigXmlWhitespace.cs
- DataTableCollection.cs
- Color.cs
- DataGridViewElement.cs
- ToolZoneDesigner.cs
- Win32.cs
- ColorDialog.cs
- ContractListAdapter.cs
- SelectionHighlightInfo.cs
- DataSetMappper.cs
- WindowsListBox.cs
- Win32SafeHandles.cs
- SmtpDigestAuthenticationModule.cs
- ObjectQuery.cs
- MediaContextNotificationWindow.cs
- RequiredAttributeAttribute.cs
- Screen.cs
- TraceContextRecord.cs
- MultiBinding.cs
- DataGridViewElement.cs
- SelectorAutomationPeer.cs
- XpsDocumentEvent.cs
- SafeNativeMethods.cs
- SerializationEventsCache.cs
- BindingValueChangedEventArgs.cs
- XmlIlVisitor.cs
- MessageQueueKey.cs
- SyndicationPerson.cs
- HitTestParameters3D.cs
- XsdDuration.cs
- DrawListViewItemEventArgs.cs
- ObjectSecurity.cs
- SiteMapNode.cs
- LinearKeyFrames.cs
- StreamSecurityUpgradeAcceptorAsyncResult.cs
- ServiceNotStartedException.cs
- EntryPointNotFoundException.cs
- Properties.cs
- BasicViewGenerator.cs
- ToolboxItemFilterAttribute.cs
- HitTestParameters.cs
- BufferedStream.cs
- SymmetricAlgorithm.cs
- ModuleConfigurationInfo.cs
- FontFamilyConverter.cs
- BindingElementExtensionElement.cs
- JsonWriter.cs
- EmbeddedMailObject.cs
- RuntimeWrappedException.cs
- ControlBuilderAttribute.cs
- TransformerConfigurationWizardBase.cs
- RegularExpressionValidator.cs
- XmlSchemaSimpleType.cs
- EntityConnectionStringBuilder.cs
- ComplexLine.cs
- SqlDataSourceSelectingEventArgs.cs
- SignedXml.cs
- XPathException.cs
- MenuItem.cs
- DataServiceRequestException.cs
- IgnoreFlushAndCloseStream.cs
- ConfigurationSettings.cs
- EventDescriptorCollection.cs
- AssociatedControlConverter.cs
- RectAnimationBase.cs
- XPathItem.cs
- AxWrapperGen.cs
- NotConverter.cs
- NonVisualControlAttribute.cs
- CompatibleComparer.cs
- NativeCppClassAttribute.cs
- _ScatterGatherBuffers.cs
- SQLSingleStorage.cs
- StatusBarPanel.cs
- StatusBarPanel.cs
- PDBReader.cs