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
- TemplateBaseAction.cs
- BinaryMessageEncodingElement.cs
- EncoderBestFitFallback.cs
- ComponentDispatcher.cs
- CryptoStream.cs
- Roles.cs
- Symbol.cs
- DefaultPropertyAttribute.cs
- CookieProtection.cs
- ContextInformation.cs
- ApplicationSecurityInfo.cs
- Overlapped.cs
- CodeThrowExceptionStatement.cs
- FontCollection.cs
- LinearGradientBrush.cs
- PaintEvent.cs
- OracleConnectionString.cs
- CqlBlock.cs
- BufferModesCollection.cs
- DirectoryObjectSecurity.cs
- figurelengthconverter.cs
- VirtualPath.cs
- PrimitiveCodeDomSerializer.cs
- DesignerAttribute.cs
- StringToken.cs
- PauseStoryboard.cs
- LocatorManager.cs
- Schema.cs
- configsystem.cs
- DataGridColumnHeadersPresenter.cs
- CurrencyWrapper.cs
- DateTimeConverter2.cs
- EventLogPermissionEntry.cs
- Wildcard.cs
- ApplyImportsAction.cs
- SBCSCodePageEncoding.cs
- DocumentViewerAutomationPeer.cs
- Crc32.cs
- HttpListener.cs
- ExpressionHelper.cs
- DesignObjectWrapper.cs
- TextEffect.cs
- SpellerHighlightLayer.cs
- ThreadStateException.cs
- ListItemParagraph.cs
- BinaryWriter.cs
- InitializationEventAttribute.cs
- DataTableClearEvent.cs
- LinkLabelLinkClickedEvent.cs
- Walker.cs
- SrgsToken.cs
- UnknownExceptionActionHelper.cs
- RSAOAEPKeyExchangeDeformatter.cs
- Command.cs
- ConfigurationElement.cs
- OutputCacheSettings.cs
- Process.cs
- Profiler.cs
- ElementUtil.cs
- DecimalAnimationUsingKeyFrames.cs
- CreateUserWizardStep.cs
- HandleRef.cs
- HttpCapabilitiesBase.cs
- BamlLocalizer.cs
- KeyValuePairs.cs
- LogStore.cs
- DataColumn.cs
- Size.cs
- PolyQuadraticBezierSegment.cs
- CustomValidator.cs
- SHA512Managed.cs
- FileDialogPermission.cs
- HttpVersion.cs
- TypeResolver.cs
- Vector3DKeyFrameCollection.cs
- HtmlControlAdapter.cs
- ProcessManager.cs
- ValidatedMobileControlConverter.cs
- datacache.cs
- FindCriteria.cs
- FixedDSBuilder.cs
- PropertyDescriptorCollection.cs
- DataExchangeServiceBinder.cs
- TransferMode.cs
- ToolStrip.cs
- DataGridColumnDropSeparator.cs
- SqlUserDefinedTypeAttribute.cs
- ListItemParagraph.cs
- URIFormatException.cs
- OdbcConnectionHandle.cs
- Sql8ExpressionRewriter.cs
- ComplusEndpointConfigContainer.cs
- SettingsPropertyWrongTypeException.cs
- StateMachine.cs
- SimpleApplicationHost.cs
- CleanUpVirtualizedItemEventArgs.cs
- User.cs
- RemotingAttributes.cs
- WindowsListViewGroupSubsetLink.cs
- LinqDataSourceDeleteEventArgs.cs