Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / Log / System / IO / Log / FileRecordSequenceCompletedAsyncResult.cs / 1 / FileRecordSequenceCompletedAsyncResult.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IO.Log { using System; using System.Diagnostics; using System.Threading; enum Work { Append, Flush, ReserveAndAppend, WriteRestartArea } sealed class FileRecordSequenceCompletedAsyncResult : IAsyncResult { SequenceNumber result; object userState; AsyncCallback callback; bool endCalled; Work work; object syncRoot; ManualResetEvent waitHandle; public FileRecordSequenceCompletedAsyncResult( SequenceNumber result, AsyncCallback callback, object userState, Work work) { this.result = result; this.callback = callback; this.userState = userState; this.work = work; this.syncRoot = new object(); if (this.callback != null) { try { this.callback(this); } #pragma warning suppress 56500 // This is a callback exception catch(Exception e) { if (DiagnosticUtility.IsFatal(e)) throw; throw DiagnosticUtility.ExceptionUtility.ThrowHelperCallback(e); } } } public Object AsyncState { get { return this.userState; } } public WaitHandle AsyncWaitHandle { get { lock(this.syncRoot) { // We won't ever close it (it must be GC'd instead), but try // not to be too excessive in allocations. // if (this.waitHandle == null) this.waitHandle = new ManualResetEvent(true); } return this.waitHandle; } } public bool CompletedSynchronously { get { return true; } } public Work CompletedWork { get { return this.work; } } public bool IsCompleted { get { return true; } } internal SequenceNumber End() { if (this.endCalled) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(Error.DuplicateEnd()); } this.endCalled = true; return this.result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FrameDimension.cs
- PerSessionInstanceContextProvider.cs
- PropertyCondition.cs
- HtmlInputImage.cs
- InlineCategoriesDocument.cs
- RegistryExceptionHelper.cs
- DataDocumentXPathNavigator.cs
- JsonXmlDataContract.cs
- Timer.cs
- HtmlFormParameterReader.cs
- SerializationInfo.cs
- GridViewUpdateEventArgs.cs
- CheckBoxStandardAdapter.cs
- DBSchemaRow.cs
- SafeSecurityHandles.cs
- FlowDocumentFormatter.cs
- FileSystemEventArgs.cs
- _SSPIWrapper.cs
- SplayTreeNode.cs
- BoundingRectTracker.cs
- ParameterBuilder.cs
- ColumnBinding.cs
- EndOfStreamException.cs
- WebPartCatalogCloseVerb.cs
- XmlAnyAttributeAttribute.cs
- ItemDragEvent.cs
- EventData.cs
- ResourcePermissionBase.cs
- BaseComponentEditor.cs
- AstNode.cs
- EncoderExceptionFallback.cs
- _DisconnectOverlappedAsyncResult.cs
- XmlNamedNodeMap.cs
- GridViewDeleteEventArgs.cs
- MethodRental.cs
- HttpResponseInternalWrapper.cs
- AmbientValueAttribute.cs
- OleDbParameterCollection.cs
- ExclusiveCanonicalizationTransform.cs
- WmlPageAdapter.cs
- RootAction.cs
- VerificationAttribute.cs
- XmlSchemaAttributeGroupRef.cs
- ResourceProviderFactory.cs
- Root.cs
- DbCommandTree.cs
- NullRuntimeConfig.cs
- DataGridCommandEventArgs.cs
- TextBox.cs
- SqlSelectStatement.cs
- DoubleLinkListEnumerator.cs
- DataBindingCollection.cs
- DNS.cs
- MethodBody.cs
- DataGridViewCellConverter.cs
- LinearGradientBrush.cs
- CompressEmulationStream.cs
- PersistChildrenAttribute.cs
- XmlSerializationGeneratedCode.cs
- WindowInteractionStateTracker.cs
- DocumentOrderComparer.cs
- XslNumber.cs
- Style.cs
- CqlLexer.cs
- NativeMethods.cs
- DefinitionUpdate.cs
- HttpApplication.cs
- AppDomain.cs
- StreamSecurityUpgradeAcceptor.cs
- ParsedAttributeCollection.cs
- TileBrush.cs
- SafeWaitHandle.cs
- SeverityFilter.cs
- DeploymentSectionCache.cs
- NativeMethods.cs
- ManualResetEventSlim.cs
- ConfigurationSectionHelper.cs
- SeverityFilter.cs
- BindingsSection.cs
- RuleConditionDialog.Designer.cs
- WebBaseEventKeyComparer.cs
- PathFigure.cs
- RemotingAttributes.cs
- BinaryExpression.cs
- CollectionChangedEventManager.cs
- ErrorFormatterPage.cs
- DataBinding.cs
- PerformanceCounterPermission.cs
- XmlSchemaComplexContentRestriction.cs
- CodeCompileUnit.cs
- IOException.cs
- HScrollProperties.cs
- UnionCqlBlock.cs
- ValidationSummary.cs
- ValidationError.cs
- SizeChangedInfo.cs
- Point4D.cs
- SyndicationSerializer.cs
- RuntimeIdentifierPropertyAttribute.cs
- CookieParameter.cs