Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Log / System / IO / Log / FileRecordSequenceCompletedAsyncResult.cs / 1305376 / FileRecordSequenceCompletedAsyncResult.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IO.Log { using System; using System.Diagnostics; using System.Runtime; 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 (Fx.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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SequenceFullException.cs
- KeyPullup.cs
- ConvertEvent.cs
- Itemizer.cs
- ActivityValidator.cs
- OdbcParameterCollection.cs
- BinaryNode.cs
- GenericPrincipal.cs
- IssuedTokenServiceCredential.cs
- UrlPath.cs
- PrintDialog.cs
- CommandValueSerializer.cs
- StyleHelper.cs
- MenuEventArgs.cs
- EncryptedPackage.cs
- Geometry3D.cs
- DBSchemaTable.cs
- PanelStyle.cs
- TabItem.cs
- StylusTouchDevice.cs
- AnnotationMap.cs
- XamlWriterExtensions.cs
- IndexedSelectQueryOperator.cs
- MdiWindowListItemConverter.cs
- CompModSwitches.cs
- CallbackException.cs
- Rotation3DAnimationUsingKeyFrames.cs
- GridPatternIdentifiers.cs
- DoubleConverter.cs
- AssemblyFilter.cs
- SymbolDocumentGenerator.cs
- DatasetMethodGenerator.cs
- XPathSelectionIterator.cs
- RemotingServices.cs
- SAPIEngineTypes.cs
- ServiceNameElementCollection.cs
- ControlBindingsCollection.cs
- ExceptionTranslationTable.cs
- EqualityComparer.cs
- BitmapEffectOutputConnector.cs
- TemplatedWizardStep.cs
- HeaderedContentControl.cs
- DataControlButton.cs
- _CookieModule.cs
- AddingNewEventArgs.cs
- CodeDelegateCreateExpression.cs
- ScalarConstant.cs
- HostProtectionException.cs
- Rect.cs
- EntityWrapperFactory.cs
- PropertyMapper.cs
- HtmlDocument.cs
- InvokeGenerator.cs
- WebHostUnsafeNativeMethods.cs
- ExpressionEditorAttribute.cs
- Msmq4PoisonHandler.cs
- SystemColors.cs
- ErrorsHelper.cs
- WebPartConnectionsEventArgs.cs
- ServiceInfo.cs
- Preprocessor.cs
- DataTableClearEvent.cs
- TypeBuilderInstantiation.cs
- AmbientLight.cs
- Message.cs
- NativeCompoundFileAPIs.cs
- _LocalDataStoreMgr.cs
- Focus.cs
- Mutex.cs
- DrawingImage.cs
- SqlWorkflowInstanceStore.cs
- CodeIndexerExpression.cs
- ToolStripContainer.cs
- RequestContextBase.cs
- XamlRtfConverter.cs
- PointCollectionValueSerializer.cs
- TableCell.cs
- ProtocolReflector.cs
- CachedCompositeFamily.cs
- DataKey.cs
- UniqueConstraint.cs
- AmbientLight.cs
- EditorServiceContext.cs
- XmlEncoding.cs
- Flattener.cs
- MILUtilities.cs
- MsdtcWrapper.cs
- DesignerCategoryAttribute.cs
- JournalEntryStack.cs
- Thumb.cs
- SponsorHelper.cs
- TypeHelper.cs
- XmlSchemaAnyAttribute.cs
- Figure.cs
- ScrollChrome.cs
- CodeObject.cs
- ToolboxItemAttribute.cs
- Int32KeyFrameCollection.cs
- SystemColorTracker.cs
- XmlRootAttribute.cs