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
- FrameworkContentElement.cs
- DesignerDataConnection.cs
- DataGridViewCellStyleConverter.cs
- InnerItemCollectionView.cs
- XamlBuildTaskServices.cs
- TargetInvocationException.cs
- OrderPreservingPipeliningMergeHelper.cs
- AuthenticateEventArgs.cs
- SimpleRecyclingCache.cs
- RegisteredScript.cs
- MouseEvent.cs
- FileDialogPermission.cs
- HttpPostedFile.cs
- __Error.cs
- ConfigurationLocation.cs
- UiaCoreApi.cs
- ItemList.cs
- PresentationTraceSources.cs
- ImageInfo.cs
- XhtmlBasicSelectionListAdapter.cs
- GroupItem.cs
- BindingCompleteEventArgs.cs
- safePerfProviderHandle.cs
- AuthenticationManager.cs
- _Connection.cs
- SynchronizationFilter.cs
- ImageFormatConverter.cs
- TextBox.cs
- CompilerError.cs
- ConditionChanges.cs
- SimpleType.cs
- SpeechEvent.cs
- DescendantBaseQuery.cs
- InputBinding.cs
- HierarchicalDataTemplate.cs
- XsltQilFactory.cs
- PropertyChangedEventArgs.cs
- EnumerableRowCollectionExtensions.cs
- ByteViewer.cs
- HttpServerProtocol.cs
- MetadataPropertyvalue.cs
- ObjectNavigationPropertyMapping.cs
- MapPathBasedVirtualPathProvider.cs
- TrailingSpaceComparer.cs
- GeneralTransform3DGroup.cs
- ISAPIRuntime.cs
- ColumnCollection.cs
- SecurityDocument.cs
- ConstructorNeedsTagAttribute.cs
- DataTableMapping.cs
- LayoutSettings.cs
- BlurEffect.cs
- ConnectionProviderAttribute.cs
- EventLogRecord.cs
- Vector3DAnimationBase.cs
- DesignerAttribute.cs
- CodeDelegateInvokeExpression.cs
- UnsafeNativeMethods.cs
- ResumeStoryboard.cs
- InputBinding.cs
- SqlInternalConnectionSmi.cs
- ToolStripItemDataObject.cs
- OpenTypeLayout.cs
- SQLBytes.cs
- ChangeBlockUndoRecord.cs
- InstanceOwnerException.cs
- MimeMapping.cs
- FixedPageProcessor.cs
- BatchServiceHost.cs
- CacheOutputQuery.cs
- JoinElimination.cs
- KoreanCalendar.cs
- HttpListenerResponse.cs
- TableCell.cs
- ChannelPool.cs
- Rights.cs
- FixedFlowMap.cs
- XmlSchema.cs
- MessageQueueTransaction.cs
- Imaging.cs
- MultipleViewProviderWrapper.cs
- DataGridCaption.cs
- CollectionViewSource.cs
- FastEncoderWindow.cs
- DependencyPropertyHelper.cs
- TaiwanCalendar.cs
- WebBrowserProgressChangedEventHandler.cs
- ExecutionEngineException.cs
- ObjectDataSourceStatusEventArgs.cs
- BindingNavigator.cs
- XmlComment.cs
- IsolatedStoragePermission.cs
- XmlNamespaceManager.cs
- SByte.cs
- WebPartDescriptionCollection.cs
- ColorConvertedBitmapExtension.cs
- XPathBinder.cs
- RowCache.cs
- DisplayInformation.cs
- HandlerMappingMemo.cs