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
- BypassElement.cs
- MetadataItem.cs
- DateRangeEvent.cs
- DataListCommandEventArgs.cs
- SecurityException.cs
- EncoderParameter.cs
- DataSet.cs
- DocumentGridPage.cs
- TransformValueSerializer.cs
- DataGridViewTextBoxCell.cs
- WpfXamlLoader.cs
- WeakReferenceKey.cs
- UiaCoreApi.cs
- TaiwanCalendar.cs
- ContentValidator.cs
- ToolStripItemClickedEventArgs.cs
- ExecutionContext.cs
- ItemCheckEvent.cs
- FullTextState.cs
- PrivilegedConfigurationManager.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- TableHeaderCell.cs
- PrintDocument.cs
- FunctionUpdateCommand.cs
- HMACMD5.cs
- TypeLoadException.cs
- ServiceNameElementCollection.cs
- PeerIPHelper.cs
- JoinSymbol.cs
- UnmanagedBitmapWrapper.cs
- ConditionalAttribute.cs
- EventWaitHandle.cs
- CellConstant.cs
- StringBuilder.cs
- DataGridViewTextBoxCell.cs
- TrackingServices.cs
- ObjectSerializerFactory.cs
- OdbcException.cs
- MachineKeyValidationConverter.cs
- WebPart.cs
- SqlCachedBuffer.cs
- HtmlProps.cs
- AdornedElementPlaceholder.cs
- WebReferencesBuildProvider.cs
- SystemDropShadowChrome.cs
- ManagedIStream.cs
- LockedAssemblyCache.cs
- Stacktrace.cs
- SQLDecimalStorage.cs
- PropertyDescriptorComparer.cs
- ConnectionConsumerAttribute.cs
- DrawingAttributesDefaultValueFactory.cs
- MemoryFailPoint.cs
- DataGridViewRowEventArgs.cs
- EventArgs.cs
- InstalledFontCollection.cs
- CompiledXpathExpr.cs
- DockProviderWrapper.cs
- MemberCollection.cs
- ByteFacetDescriptionElement.cs
- StylusButtonEventArgs.cs
- CodeEntryPointMethod.cs
- DataRowChangeEvent.cs
- SqlServices.cs
- ResourceCodeDomSerializer.cs
- backend.cs
- DataSvcMapFile.cs
- BrowserCapabilitiesFactory.cs
- BaseAppDomainProtocolHandler.cs
- DataKeyCollection.cs
- ProgressBarAutomationPeer.cs
- Rotation3DAnimationBase.cs
- EmptyStringExpandableObjectConverter.cs
- Screen.cs
- RIPEMD160Managed.cs
- DataKey.cs
- WindowsImpersonationContext.cs
- MappingSource.cs
- DateTimeConverter.cs
- Thread.cs
- PropertyGridDesigner.cs
- FormViewRow.cs
- QilStrConcat.cs
- DictionaryBase.cs
- GeometryGroup.cs
- MatrixAnimationUsingPath.cs
- MemoryStream.cs
- ModelChangedEventArgsImpl.cs
- CollectionDataContract.cs
- BoundsDrawingContextWalker.cs
- ITreeGenerator.cs
- AutoGeneratedFieldProperties.cs
- EventRoute.cs
- ChangePassword.cs
- ImageMapEventArgs.cs
- ScrollItemPatternIdentifiers.cs
- ArgumentNullException.cs
- ToolTipAutomationPeer.cs
- SessionEndedEventArgs.cs
- PathHelper.cs