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
- BaseParaClient.cs
- EntryIndex.cs
- IdleTimeoutMonitor.cs
- FontFamilyValueSerializer.cs
- TypeForwardedToAttribute.cs
- SoundPlayer.cs
- ConfigXmlCDataSection.cs
- StructuredTypeInfo.cs
- InputProcessorProfilesLoader.cs
- _Win32.cs
- DropSource.cs
- RedirectionProxy.cs
- WebPartManagerInternals.cs
- CompilerError.cs
- ComponentResourceKey.cs
- DynamicRenderer.cs
- TextRunProperties.cs
- ListItemsCollectionEditor.cs
- XPathMultyIterator.cs
- WmpBitmapDecoder.cs
- TextMessageEncodingElement.cs
- PrimitiveCodeDomSerializer.cs
- MultitargetingHelpers.cs
- Buffer.cs
- CqlWriter.cs
- SocketInformation.cs
- UnknownBitmapDecoder.cs
- MeasurementDCInfo.cs
- Cursor.cs
- Membership.cs
- Gdiplus.cs
- CatalogZoneBase.cs
- _NestedMultipleAsyncResult.cs
- ProviderException.cs
- HtmlCommandAdapter.cs
- InputMethodStateTypeInfo.cs
- OfTypeExpression.cs
- CodeArgumentReferenceExpression.cs
- ZipIOFileItemStream.cs
- ClientUrlResolverWrapper.cs
- ResourceReader.cs
- Currency.cs
- Visual3DCollection.cs
- FrameworkElement.cs
- FileStream.cs
- Drawing.cs
- XdrBuilder.cs
- SharedStream.cs
- SecurityDocument.cs
- CheckBox.cs
- NTAccount.cs
- SQLByteStorage.cs
- ChannelToken.cs
- ReadonlyMessageFilter.cs
- X509SecurityTokenProvider.cs
- ConfigurationPropertyCollection.cs
- PackWebRequest.cs
- CustomErrorsSection.cs
- NativeMethods.cs
- NamespaceEmitter.cs
- GB18030Encoding.cs
- documentation.cs
- TreeViewCancelEvent.cs
- ItemAutomationPeer.cs
- ColorInterpolationModeValidation.cs
- UnsafePeerToPeerMethods.cs
- MDIControlStrip.cs
- BlobPersonalizationState.cs
- KeyGesture.cs
- TransformerConfigurationWizardBase.cs
- MethodToken.cs
- DBSqlParserColumnCollection.cs
- AesManaged.cs
- HtmlInputButton.cs
- EntityDataReader.cs
- ScrollItemPatternIdentifiers.cs
- WorkflowRuntimeServiceElementCollection.cs
- CompilationRelaxations.cs
- PrintEvent.cs
- TemplateAction.cs
- HtmlForm.cs
- QilParameter.cs
- SiteOfOriginContainer.cs
- ControlValuePropertyAttribute.cs
- InputLanguageCollection.cs
- WaveHeader.cs
- StreamInfo.cs
- webbrowsersite.cs
- ContentFilePart.cs
- CustomValidator.cs
- KeyToListMap.cs
- RectangleHotSpot.cs
- LocalClientSecuritySettingsElement.cs
- UntrustedRecipientException.cs
- OrderedDictionary.cs
- SettingsBase.cs
- SqlDataReader.cs
- StrongName.cs
- Point3DCollectionConverter.cs
- DesignerAutoFormatStyle.cs