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
- DbDataRecord.cs
- TypedReference.cs
- _NegotiateClient.cs
- KeyManager.cs
- MergePropertyDescriptor.cs
- PLINQETWProvider.cs
- DesignerVerbCollection.cs
- BufferedReadStream.cs
- StylusPointPropertyUnit.cs
- Classification.cs
- StreamFormatter.cs
- NetMsmqBindingElement.cs
- dbdatarecord.cs
- Helpers.cs
- XmlSerializableWriter.cs
- HWStack.cs
- CompModSwitches.cs
- WebAdminConfigurationHelper.cs
- CounterSampleCalculator.cs
- BamlResourceContent.cs
- FontFamily.cs
- ListViewDataItem.cs
- MetadataCache.cs
- SafeArchiveContext.cs
- FilteredXmlReader.cs
- TableColumn.cs
- CFGGrammar.cs
- SpecialNameAttribute.cs
- XamlGridLengthSerializer.cs
- ObjectConverter.cs
- ImageCodecInfo.cs
- ToolStripItemEventArgs.cs
- IIS7WorkerRequest.cs
- SourceSwitch.cs
- AttributeQuery.cs
- WebPartCancelEventArgs.cs
- DbParameterCollection.cs
- Image.cs
- SqlBulkCopyColumnMappingCollection.cs
- GridItem.cs
- BevelBitmapEffect.cs
- TextBoxRenderer.cs
- MenuItemBindingCollection.cs
- HttpResponseWrapper.cs
- PrintingPermissionAttribute.cs
- HandleCollector.cs
- DocumentViewerBaseAutomationPeer.cs
- NamespaceListProperty.cs
- DoubleStorage.cs
- DatatypeImplementation.cs
- SessionIDManager.cs
- BindableAttribute.cs
- XmlBinaryReader.cs
- OutputCacheSettingsSection.cs
- MissingManifestResourceException.cs
- StubHelpers.cs
- ExpressionBindingCollection.cs
- WindowsTitleBar.cs
- DataBindingCollectionEditor.cs
- Decimal.cs
- SqlBuilder.cs
- SchemaEntity.cs
- ActivityTypeDesigner.xaml.cs
- XmlILStorageConverter.cs
- ConfigXmlElement.cs
- WebProxyScriptElement.cs
- Repeater.cs
- DeferredBinaryDeserializerExtension.cs
- Unit.cs
- GeneralTransformGroup.cs
- DataGridViewRowCancelEventArgs.cs
- SimpleLine.cs
- TreeWalker.cs
- FunctionQuery.cs
- PerfCounterSection.cs
- DrawListViewSubItemEventArgs.cs
- XmlWrappingReader.cs
- DateTimeConverter.cs
- MessageDecoder.cs
- sqlnorm.cs
- RpcCryptoRequest.cs
- SqlBuffer.cs
- DesigntimeLicenseContextSerializer.cs
- TreeBuilder.cs
- PriorityChain.cs
- NativeMethods.cs
- XamlWriterExtensions.cs
- CookielessData.cs
- RichTextBoxAutomationPeer.cs
- QuaternionValueSerializer.cs
- ProfessionalColorTable.cs
- CodeRegionDirective.cs
- TemplatedMailWebEventProvider.cs
- BulletedList.cs
- TableParaClient.cs
- ToolStripItemClickedEventArgs.cs
- MarshalDirectiveException.cs
- OneWayElement.cs
- SoapReflectionImporter.cs
- TextSelectionHelper.cs