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
- SrgsRule.cs
- PageContent.cs
- HashRepartitionEnumerator.cs
- Touch.cs
- TypeLibConverter.cs
- WebPartManagerInternals.cs
- EmptyWorkItem.cs
- StickyNoteAnnotations.cs
- FunctionUpdateCommand.cs
- CodeNamespaceImportCollection.cs
- LongMinMaxAggregationOperator.cs
- AuthenticateEventArgs.cs
- ConfigurationPropertyAttribute.cs
- DesignTimeXamlWriter.cs
- WindowsFormsSectionHandler.cs
- PropertyNames.cs
- _IPv4Address.cs
- DataGrid.cs
- GenericUI.cs
- EditorBrowsableAttribute.cs
- unsafeIndexingFilterStream.cs
- HttpModuleActionCollection.cs
- EventWaitHandleSecurity.cs
- CollectionViewSource.cs
- RuleSettings.cs
- InitializationEventAttribute.cs
- HttpCachePolicyBase.cs
- RepeatEnumerable.cs
- AnimationLayer.cs
- TypeForwardedToAttribute.cs
- SecurityTokenResolver.cs
- GenericWebPart.cs
- SHA256Managed.cs
- TTSEngineProxy.cs
- MimeObjectFactory.cs
- CrossContextChannel.cs
- PassportIdentity.cs
- TokenBasedSet.cs
- OleServicesContext.cs
- ThreadInterruptedException.cs
- NonDualMessageSecurityOverHttp.cs
- DataGridViewCellMouseEventArgs.cs
- ApplyTemplatesAction.cs
- Token.cs
- OutputCacheSection.cs
- namescope.cs
- XhtmlBasicPhoneCallAdapter.cs
- SelectionRange.cs
- ModelMemberCollection.cs
- SafeNativeMethods.cs
- AsyncOperation.cs
- BaseProcessProtocolHandler.cs
- SimpleHandlerFactory.cs
- BinHexEncoder.cs
- TransformValueSerializer.cs
- ErrorEventArgs.cs
- XPathNodeList.cs
- OracleString.cs
- EventMappingSettingsCollection.cs
- DbParameterCollection.cs
- TextMessageEncodingBindingElement.cs
- SplitterCancelEvent.cs
- TcpDuplicateContext.cs
- DataListItem.cs
- BitmapData.cs
- NamespaceList.cs
- DriveNotFoundException.cs
- StaticSiteMapProvider.cs
- XmlSchemaDatatype.cs
- ConnectorMovedEventArgs.cs
- ParameterToken.cs
- RegexCode.cs
- ShellProvider.cs
- JsonReaderWriterFactory.cs
- RuleAttributes.cs
- SerializationAttributes.cs
- SimpleFileLog.cs
- MediaTimeline.cs
- DefaultClaimSet.cs
- MULTI_QI.cs
- ConfigurationManagerHelper.cs
- ProxyGenerator.cs
- CommandLineParser.cs
- Table.cs
- PropVariant.cs
- OdbcConnectionString.cs
- LabelLiteral.cs
- ServicePoint.cs
- MenuItemBinding.cs
- MethodBuilder.cs
- FormsIdentity.cs
- DataBinding.cs
- GridViewAutoFormat.cs
- Timer.cs
- ActivityBindForm.Designer.cs
- Quad.cs
- SystemMulticastIPAddressInformation.cs
- CompilerWrapper.cs
- Page.cs
- ClientSession.cs