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
- StyleCollection.cs
- StorageComplexTypeMapping.cs
- SerializableAttribute.cs
- _Win32.cs
- HtmlLink.cs
- DynamicAttribute.cs
- NullReferenceException.cs
- CqlGenerator.cs
- ActiveXHost.cs
- CodeBlockBuilder.cs
- XmlValueConverter.cs
- NativeWindow.cs
- SafeNativeMethods.cs
- CodeStatementCollection.cs
- AttachedPropertiesService.cs
- FormParameter.cs
- MobileErrorInfo.cs
- TypeSystem.cs
- EdmToObjectNamespaceMap.cs
- FigureParagraph.cs
- ASCIIEncoding.cs
- GraphicsContext.cs
- DataGridViewColumnHeaderCell.cs
- TraceListener.cs
- assertwrapper.cs
- GuidelineCollection.cs
- AutoResetEvent.cs
- SectionInput.cs
- SqlDependencyUtils.cs
- AdapterSwitches.cs
- _Connection.cs
- DataComponentMethodGenerator.cs
- KeyMatchBuilder.cs
- ISAPIApplicationHost.cs
- ExtensionSimplifierMarkupObject.cs
- TempFiles.cs
- FontFaceLayoutInfo.cs
- DeclarativeConditionsCollection.cs
- TraceListeners.cs
- MessageFilterTable.cs
- BuildProviderInstallComponent.cs
- TableRowGroup.cs
- BorderGapMaskConverter.cs
- __Error.cs
- TextTreeUndo.cs
- ISO2022Encoding.cs
- CompilerGeneratedAttribute.cs
- FixedLineResult.cs
- RuleSetReference.cs
- XhtmlBasicPageAdapter.cs
- WindowsComboBox.cs
- WCFServiceClientProxyGenerator.cs
- UnsafeCollabNativeMethods.cs
- InitializationEventAttribute.cs
- SolidBrush.cs
- DurableInstancingOptions.cs
- HashRepartitionEnumerator.cs
- BeginStoryboard.cs
- AttributeUsageAttribute.cs
- WebBrowserBase.cs
- ChannelPoolSettingsElement.cs
- ActivityExecutorOperation.cs
- X509ChainElement.cs
- XmlWriter.cs
- TraceHandler.cs
- GeneralTransformGroup.cs
- TemplateBuilder.cs
- Qualifier.cs
- FlagsAttribute.cs
- SqlProvider.cs
- DbProviderFactoriesConfigurationHandler.cs
- MissingManifestResourceException.cs
- PolicyVersion.cs
- NativeMethods.cs
- PageThemeParser.cs
- ColorTransformHelper.cs
- MissingFieldException.cs
- HttpRawResponse.cs
- MetadataArtifactLoaderCompositeFile.cs
- AppendHelper.cs
- CustomAttributeBuilder.cs
- Collection.cs
- LineGeometry.cs
- XmlSchemaType.cs
- XmlSchemaAttributeGroupRef.cs
- RNGCryptoServiceProvider.cs
- RotateTransform.cs
- BidirectionalDictionary.cs
- HostSecurityManager.cs
- Ipv6Element.cs
- NameScope.cs
- LabelAutomationPeer.cs
- RotateTransform.cs
- PropertyGeneratedEventArgs.cs
- GlobalId.cs
- MultiSelectRootGridEntry.cs
- EnvelopedPkcs7.cs
- SqlProcedureAttribute.cs
- DesignBindingConverter.cs
- VisualBrush.cs