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
- Point3DValueSerializer.cs
- Label.cs
- SoapFault.cs
- UnionCodeGroup.cs
- PersonalizationStateQuery.cs
- SafeRightsManagementPubHandle.cs
- IPPacketInformation.cs
- DataGridColumn.cs
- CompiledIdentityConstraint.cs
- ObjectAnimationUsingKeyFrames.cs
- ToolTipAutomationPeer.cs
- PipelineModuleStepContainer.cs
- FontSourceCollection.cs
- IsolatedStoragePermission.cs
- ResourceAttributes.cs
- Guid.cs
- X509InitiatorCertificateClientElement.cs
- DispatcherExceptionEventArgs.cs
- figurelengthconverter.cs
- FixedSOMSemanticBox.cs
- FilteredXmlReader.cs
- WebPartZone.cs
- SelectionProviderWrapper.cs
- SortedDictionary.cs
- PatternMatcher.cs
- HttpConfigurationContext.cs
- Variant.cs
- GenericFlowSwitchHelper.cs
- RangeValuePatternIdentifiers.cs
- X509SecurityTokenProvider.cs
- WindowsStatusBar.cs
- Baml6ConstructorInfo.cs
- MarkupProperty.cs
- Run.cs
- IListConverters.cs
- SmiTypedGetterSetter.cs
- DbSourceParameterCollection.cs
- DebugController.cs
- CodeTypeDeclarationCollection.cs
- ColumnClickEvent.cs
- AdapterSwitches.cs
- ByteAnimation.cs
- SecurityResources.cs
- BindingEntityInfo.cs
- PerformanceCounterLib.cs
- XmlArrayItemAttribute.cs
- CryptoApi.cs
- AnnotationMap.cs
- DataObjectFieldAttribute.cs
- EntityDesignerDataSourceView.cs
- NavigationExpr.cs
- CodeSubDirectory.cs
- BamlRecordHelper.cs
- Interlocked.cs
- ProtocolsConfigurationEntry.cs
- Vector3D.cs
- BlockExpression.cs
- ValueChangedEventManager.cs
- DataGridTablesFactory.cs
- SpellerStatusTable.cs
- DataTableMapping.cs
- TextRangeEdit.cs
- EditCommandColumn.cs
- EdmProperty.cs
- ZipArchive.cs
- Keyboard.cs
- DelimitedListTraceListener.cs
- Int32Rect.cs
- CachedFontFace.cs
- RouteItem.cs
- Content.cs
- ContainerControl.cs
- SrgsToken.cs
- DbSourceCommand.cs
- CommonDialog.cs
- EndpointPerformanceCounters.cs
- DefaultBinder.cs
- SelectionEditor.cs
- SchemaImporterExtension.cs
- CompositeFontParser.cs
- QueryContinueDragEventArgs.cs
- StrokeFIndices.cs
- DelegateBodyWriter.cs
- InputMethodStateChangeEventArgs.cs
- SiteOfOriginPart.cs
- SynchronizedDispatch.cs
- DelegatingTypeDescriptionProvider.cs
- ManagementObjectCollection.cs
- ProgressBarHighlightConverter.cs
- ToolStripDropDownButton.cs
- ReferencedCollectionType.cs
- SqlDataSourceQueryEditorForm.cs
- AsyncOperationManager.cs
- DefaultPropertyAttribute.cs
- MsmqNonTransactedPoisonHandler.cs
- WsatTransactionHeader.cs
- TextTrailingCharacterEllipsis.cs
- WebBrowser.cs
- FieldAccessException.cs
- UserControlAutomationPeer.cs