Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Log / System / IO / Log / FileRecordSequenceCompletedAsyncResult.cs / 1305376 / FileRecordSequenceCompletedAsyncResult.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IO.Log { using System; using System.Diagnostics; using System.Runtime; 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 (Fx.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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridViewToolTip.cs
- TrustSection.cs
- SchemaImporterExtension.cs
- Matrix.cs
- EastAsianLunisolarCalendar.cs
- Table.cs
- ContentIterators.cs
- ReferentialConstraint.cs
- FolderBrowserDialog.cs
- _LoggingObject.cs
- EventProxy.cs
- RegexTree.cs
- XmlTextReaderImplHelpers.cs
- BamlRecordReader.cs
- Accessors.cs
- Win32Exception.cs
- HtmlInputPassword.cs
- OrthographicCamera.cs
- BinaryWriter.cs
- NavigationHelper.cs
- printdlgexmarshaler.cs
- PointHitTestParameters.cs
- Nodes.cs
- WindowsFormsSectionHandler.cs
- SignedPkcs7.cs
- CompositeCollection.cs
- WindowsPrincipal.cs
- Matrix3DConverter.cs
- Descriptor.cs
- WaitHandle.cs
- SoapAttributeOverrides.cs
- Rotation3DKeyFrameCollection.cs
- Size.cs
- RayMeshGeometry3DHitTestResult.cs
- MetabaseServerConfig.cs
- ExecutionEngineException.cs
- TextInfo.cs
- SystemTcpConnection.cs
- DSASignatureFormatter.cs
- ParameterCollection.cs
- ComponentResourceKeyConverter.cs
- MailAddressCollection.cs
- DesignerTransaction.cs
- MatrixTransform3D.cs
- InputLanguageCollection.cs
- LoginDesignerUtil.cs
- FileInfo.cs
- SaveCardRequest.cs
- exports.cs
- invalidudtexception.cs
- WeakHashtable.cs
- OverlappedAsyncResult.cs
- PrivilegedConfigurationManager.cs
- SequenceDesignerAccessibleObject.cs
- DbProviderFactory.cs
- ConfigurationManagerHelper.cs
- HttpDictionary.cs
- TypeSemantics.cs
- ProxyDataContractResolver.cs
- OleDbMetaDataFactory.cs
- XsltException.cs
- RichTextBox.cs
- FrameworkContentElementAutomationPeer.cs
- EventSinkHelperWriter.cs
- XmlResolver.cs
- TextParagraphView.cs
- ServiceHttpModule.cs
- SByteConverter.cs
- BinaryFormatter.cs
- ReferencedAssemblyResolver.cs
- PageCodeDomTreeGenerator.cs
- ListItemCollection.cs
- ParameterModifier.cs
- ClientClassGenerator.cs
- ListChunk.cs
- DocumentCollection.cs
- InputProcessorProfilesLoader.cs
- DesignOnlyAttribute.cs
- CharacterBuffer.cs
- AssociationTypeEmitter.cs
- XmlAttributeAttribute.cs
- TaiwanCalendar.cs
- Native.cs
- _SpnDictionary.cs
- SQLDateTime.cs
- EventsTab.cs
- SelectionItemPattern.cs
- SelectedDatesCollection.cs
- DbConnectionClosed.cs
- DataGridItemEventArgs.cs
- XsltConvert.cs
- ValidationContext.cs
- StreamedFramingRequestChannel.cs
- ListBoxItem.cs
- Byte.cs
- CounterSample.cs
- HtmlControl.cs
- ApplicationServiceHelper.cs
- DependencySource.cs
- DataGridViewCellStyle.cs