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
- IIS7WorkerRequest.cs
- OutKeywords.cs
- MemoryRecordBuffer.cs
- panel.cs
- EntityCommandDefinition.cs
- NumberSubstitution.cs
- DataComponentGenerator.cs
- XmlSchemaObject.cs
- CommonGetThemePartSize.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- Size.cs
- DispatchChannelSink.cs
- VectorConverter.cs
- baseshape.cs
- EventSinkHelperWriter.cs
- LayoutUtils.cs
- FieldNameLookup.cs
- EventWaitHandleSecurity.cs
- CollectionContainer.cs
- SystemResourceHost.cs
- StylusPointPropertyInfoDefaults.cs
- WindowsHyperlink.cs
- CodeGotoStatement.cs
- DataService.cs
- SelectManyQueryOperator.cs
- TypeConverterAttribute.cs
- SystemParameters.cs
- GPRECTF.cs
- _NativeSSPI.cs
- AdministrationHelpers.cs
- MobileContainerDesigner.cs
- WebRequestModuleElementCollection.cs
- CodeSnippetTypeMember.cs
- MembershipUser.cs
- GridViewAutomationPeer.cs
- StoreConnection.cs
- CellTreeNodeVisitors.cs
- PrtTicket_Editor.cs
- CreateDataSourceDialog.cs
- ReplyChannel.cs
- GeometryDrawing.cs
- QueryableFilterUserControl.cs
- TTSEngineTypes.cs
- AttachmentService.cs
- DeferredReference.cs
- EntityDesignerUtils.cs
- DropDownList.cs
- SerializationObjectManager.cs
- XmlIlTypeHelper.cs
- BitConverter.cs
- WaitForChangedResult.cs
- OdbcEnvironment.cs
- WrappedIUnknown.cs
- XmlWriter.cs
- EastAsianLunisolarCalendar.cs
- DataSourceXmlSerializationAttribute.cs
- ToolboxItemWrapper.cs
- SqlColumnizer.cs
- FieldCollectionEditor.cs
- ComPlusTypeValidator.cs
- FolderNameEditor.cs
- Sequence.cs
- DataServiceKeyAttribute.cs
- ProgressBar.cs
- TemplateControlParser.cs
- AddressUtility.cs
- DataBinding.cs
- StylusShape.cs
- PersonalizationStateInfoCollection.cs
- WorkflowPersistenceService.cs
- ForeignConstraint.cs
- StoreUtilities.cs
- XmlSchemaCompilationSettings.cs
- ArcSegment.cs
- SetterBase.cs
- CallbackException.cs
- IisTraceListener.cs
- AxisAngleRotation3D.cs
- securitymgrsite.cs
- wgx_commands.cs
- panel.cs
- DateTimeOffset.cs
- _FtpControlStream.cs
- ProxyAttribute.cs
- MatrixConverter.cs
- PositiveTimeSpanValidator.cs
- SHA1CryptoServiceProvider.cs
- ComponentDispatcher.cs
- ToolStripItemTextRenderEventArgs.cs
- DBAsyncResult.cs
- HelpProvider.cs
- BuilderPropertyEntry.cs
- EndOfStreamException.cs
- ImageAnimator.cs
- FirewallWrapper.cs
- ProcessHostFactoryHelper.cs
- ConvertTextFrag.cs
- WindowsTab.cs
- DBBindings.cs
- Dictionary.cs