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
- DesignerForm.cs
- PrintPreviewGraphics.cs
- DetailsView.cs
- TextCompositionManager.cs
- XmlSerializerAssemblyAttribute.cs
- ValidationHelpers.cs
- ConfigurationStrings.cs
- RequestSecurityTokenResponseCollection.cs
- HyperLink.cs
- HttpValueCollection.cs
- XPathDocumentBuilder.cs
- EntitySetDataBindingList.cs
- XmlNamedNodeMap.cs
- TTSEvent.cs
- TriState.cs
- ServiceModelConfigurationSection.cs
- TCPClient.cs
- EventManager.cs
- DurableMessageDispatchInspector.cs
- NativeMethods.cs
- StrongNameHelpers.cs
- PropertyCondition.cs
- Expressions.cs
- ServicesUtilities.cs
- DateTimeFormatInfo.cs
- RoleGroup.cs
- LoadedOrUnloadedOperation.cs
- HtmlInputText.cs
- JournalEntryStack.cs
- LineSegment.cs
- UnlockCardRequest.cs
- ClientSettings.cs
- RegexReplacement.cs
- OptimizedTemplateContent.cs
- AudioFormatConverter.cs
- ProtocolInformationReader.cs
- BaseDataListActionList.cs
- SystemTcpStatistics.cs
- StringInfo.cs
- PermissionListSet.cs
- TraceHwndHost.cs
- HealthMonitoringSection.cs
- webbrowsersite.cs
- FormViewUpdateEventArgs.cs
- InfoCardBaseException.cs
- _ContextAwareResult.cs
- GridViewActionList.cs
- ServiceBehaviorElementCollection.cs
- ParserHooks.cs
- ClientSettingsStore.cs
- DeviceContext2.cs
- PropertyIDSet.cs
- DNS.cs
- ChameleonKey.cs
- SkinBuilder.cs
- SectionInput.cs
- TransformDescriptor.cs
- WebBrowserHelper.cs
- OleServicesContext.cs
- BitmapCodecInfo.cs
- DataColumnMapping.cs
- SiteMap.cs
- UnknownBitmapDecoder.cs
- SmiSettersStream.cs
- XmlSchemaFacet.cs
- ComponentTray.cs
- Int32RectConverter.cs
- MetadataArtifactLoaderComposite.cs
- ReferencedCategoriesDocument.cs
- ModelPropertyImpl.cs
- PerfCounters.cs
- DataRelationPropertyDescriptor.cs
- CombinedGeometry.cs
- AssemblyCache.cs
- altserialization.cs
- XmlEntity.cs
- ContentDisposition.cs
- EntryWrittenEventArgs.cs
- DataServiceCollectionOfT.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- RectangleHotSpot.cs
- BoolExpressionVisitors.cs
- httpapplicationstate.cs
- NotifyParentPropertyAttribute.cs
- CodeStatement.cs
- WorkflowLayouts.cs
- COM2Properties.cs
- MatrixValueSerializer.cs
- DeferredReference.cs
- FlowDocumentPageViewerAutomationPeer.cs
- MetadataItem_Static.cs
- LongTypeConverter.cs
- ActivityCollectionMarkupSerializer.cs
- PersistenceProvider.cs
- BitmapEffectGroup.cs
- WindowsSecurityToken.cs
- ResourceIDHelper.cs
- DesigntimeLicenseContextSerializer.cs
- ProtocolsConfigurationEntry.cs
- SiteMapNodeItem.cs