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
- ModuleBuilderData.cs
- ExpressionSelection.cs
- InputProcessorProfiles.cs
- TextContainerHelper.cs
- InlineUIContainer.cs
- ListItemCollection.cs
- ServiceContractViewControl.Designer.cs
- Int16KeyFrameCollection.cs
- TextTrailingCharacterEllipsis.cs
- DiscoveryMessageSequence11.cs
- ConnectionManagementElement.cs
- WinFormsUtils.cs
- BuildProvidersCompiler.cs
- Selection.cs
- MouseGestureConverter.cs
- WorkflowFileItem.cs
- TransformerInfoCollection.cs
- StreamSecurityUpgradeInitiator.cs
- ACL.cs
- Pen.cs
- MatrixAnimationUsingPath.cs
- SettingsProperty.cs
- DrawingAttributeSerializer.cs
- Underline.cs
- ConstraintConverter.cs
- XmlStringTable.cs
- DeclarativeCatalogPart.cs
- EdmType.cs
- SessionParameter.cs
- QuadraticBezierSegment.cs
- NotImplementedException.cs
- AddIn.cs
- RecognizeCompletedEventArgs.cs
- StaticResourceExtension.cs
- PeerName.cs
- AuthenticatingEventArgs.cs
- Journaling.cs
- LabelAutomationPeer.cs
- Vars.cs
- AssemblyInfo.cs
- PlainXmlWriter.cs
- RuleSetBrowserDialog.cs
- ChooseAction.cs
- Panel.cs
- _CookieModule.cs
- ColumnWidthChangedEvent.cs
- messageonlyhwndwrapper.cs
- XPathNavigatorReader.cs
- MetafileHeaderWmf.cs
- ConsoleTraceListener.cs
- XmlSchemaExternal.cs
- AbstractExpressions.cs
- XappLauncher.cs
- Row.cs
- EncoderParameter.cs
- PageRouteHandler.cs
- FormatterServicesNoSerializableCheck.cs
- HtmlInputSubmit.cs
- BidirectionalDictionary.cs
- BinaryReader.cs
- XmlnsDictionary.cs
- ConnectionManagementElementCollection.cs
- EventEntry.cs
- CustomCategoryAttribute.cs
- StringArrayConverter.cs
- DataSetMappper.cs
- PropertySegmentSerializationProvider.cs
- StopRoutingHandler.cs
- CompressionTransform.cs
- ErrorFormatter.cs
- XmlSchemaChoice.cs
- CroppedBitmap.cs
- ByteFacetDescriptionElement.cs
- MissingMethodException.cs
- UserPreferenceChangingEventArgs.cs
- DataObject.cs
- SoapMessage.cs
- StylusButton.cs
- ConfigPathUtility.cs
- MailWriter.cs
- SQLByteStorage.cs
- WebPartVerbCollection.cs
- EndOfStreamException.cs
- RowToFieldTransformer.cs
- ManagedWndProcTracker.cs
- ColumnReorderedEventArgs.cs
- Int32EqualityComparer.cs
- LassoHelper.cs
- AbandonedMutexException.cs
- AutomationPattern.cs
- DbCommandTree.cs
- BaseDataList.cs
- ArraySortHelper.cs
- SelectionProcessor.cs
- Pen.cs
- MessageQueuePermissionEntry.cs
- ExpressionContext.cs
- SplineKeyFrames.cs
- Wizard.cs
- MemberPath.cs