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
- PTConverter.cs
- BitConverter.cs
- GridViewDeletedEventArgs.cs
- RequestUriProcessor.cs
- DataKeyPropertyAttribute.cs
- TagMapInfo.cs
- C14NUtil.cs
- Label.cs
- XmlHierarchicalEnumerable.cs
- SizeKeyFrameCollection.cs
- Rotation3DKeyFrameCollection.cs
- brushes.cs
- Span.cs
- _ChunkParse.cs
- SqlCommand.cs
- RenderDataDrawingContext.cs
- BeginStoryboard.cs
- BuildDependencySet.cs
- BaseValidator.cs
- Wizard.cs
- DataControlButton.cs
- RectAnimationUsingKeyFrames.cs
- QuaternionRotation3D.cs
- DomNameTable.cs
- webeventbuffer.cs
- CalendarKeyboardHelper.cs
- recordstatescratchpad.cs
- HGlobalSafeHandle.cs
- SectionRecord.cs
- RoleGroup.cs
- LayoutEngine.cs
- SymmetricCryptoHandle.cs
- AssociatedControlConverter.cs
- ReachSerializationUtils.cs
- HttpDictionary.cs
- SerializationHelper.cs
- BitmapEffectOutputConnector.cs
- BamlResourceDeserializer.cs
- SecurityStateEncoder.cs
- ToolStripAdornerWindowService.cs
- LightweightEntityWrapper.cs
- SchemaImporterExtensionElementCollection.cs
- Size.cs
- Rotation3DAnimation.cs
- ImageListUtils.cs
- DirectoryGroupQuery.cs
- DataContext.cs
- SettingsContext.cs
- SmtpClient.cs
- AutoGeneratedField.cs
- Matrix3DStack.cs
- DataGridSortCommandEventArgs.cs
- EraserBehavior.cs
- TemplateBindingExtensionConverter.cs
- ApplicationFileCodeDomTreeGenerator.cs
- HttpFileCollectionBase.cs
- wgx_render.cs
- FontWeightConverter.cs
- FlowDocument.cs
- ResXBuildProvider.cs
- WorkflowMarkupSerializationProvider.cs
- ParsedAttributeCollection.cs
- PropertyInfo.cs
- _TransmitFileOverlappedAsyncResult.cs
- SqlCacheDependencyDatabase.cs
- ServiceObjectContainer.cs
- PointIndependentAnimationStorage.cs
- TrackingWorkflowEventArgs.cs
- XmlTextEncoder.cs
- Double.cs
- dataprotectionpermission.cs
- InputElement.cs
- ColumnBinding.cs
- TextureBrush.cs
- ComponentDispatcherThread.cs
- DataGridViewControlCollection.cs
- HttpHostedTransportConfiguration.cs
- IsolationInterop.cs
- CodeObject.cs
- ActivityBuilderHelper.cs
- panel.cs
- HtmlGenericControl.cs
- WindowsFont.cs
- EntityDataSourceStatementEditorForm.cs
- DbConnectionPoolCounters.cs
- XmlAtomicValue.cs
- MdiWindowListStrip.cs
- MergeLocalizationDirectives.cs
- MessageSmuggler.cs
- Model3D.cs
- GridViewRow.cs
- ToolBar.cs
- KeyBinding.cs
- SqlBuilder.cs
- DataGridRowClipboardEventArgs.cs
- ProxyFragment.cs
- SQLStringStorage.cs
- StateMachineSubscriptionManager.cs
- PropertyMetadata.cs
- MenuItemCollection.cs