Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Services / Messaging / System / Messaging / Cursor.cs / 1305376 / Cursor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Messaging { using System.Messaging.Interop; public sealed class Cursor : IDisposable { private CursorHandle handle; private bool disposed; internal Cursor(MessageQueue queue) { CursorHandle result; int status = SafeNativeMethods.MQCreateCursor(queue.MQInfo.ReadHandle, out result); if (MessageQueue.IsFatalError(status)) throw new MessageQueueException(status); this.handle = result; } internal CursorHandle Handle { get { if (disposed) throw new ObjectDisposedException(GetType().Name); return handle; } } public void Close() { handle.Close(); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } void Dispose(bool disposing) { // disposing argument is intentionally unused this.Close(); this.disposed = true; } ~Cursor() { Dispose(false); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Messaging { using System.Messaging.Interop; public sealed class Cursor : IDisposable { private CursorHandle handle; private bool disposed; internal Cursor(MessageQueue queue) { CursorHandle result; int status = SafeNativeMethods.MQCreateCursor(queue.MQInfo.ReadHandle, out result); if (MessageQueue.IsFatalError(status)) throw new MessageQueueException(status); this.handle = result; } internal CursorHandle Handle { get { if (disposed) throw new ObjectDisposedException(GetType().Name); return handle; } } public void Close() { handle.Close(); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } void Dispose(bool disposing) { // disposing argument is intentionally unused this.Close(); this.disposed = true; } ~Cursor() { Dispose(false); } } } // 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
- COM2FontConverter.cs
- SerializerWriterEventHandlers.cs
- RemotingClientProxy.cs
- DataGridViewAutoSizeModeEventArgs.cs
- InputBindingCollection.cs
- Geometry.cs
- PrimitiveType.cs
- ParentQuery.cs
- SqlConnectionHelper.cs
- KeyedHashAlgorithm.cs
- HttpClientCertificate.cs
- SafeHandles.cs
- __TransparentProxy.cs
- HttpPostedFile.cs
- StrongNameKeyPair.cs
- ProxyManager.cs
- KeyInterop.cs
- SqlProfileProvider.cs
- DomNameTable.cs
- WebBrowserUriTypeConverter.cs
- ControlDesignerState.cs
- FileCodeGroup.cs
- PageContentAsyncResult.cs
- ZeroOpNode.cs
- CheckableControlBaseAdapter.cs
- MouseCaptureWithinProperty.cs
- RectConverter.cs
- DatePicker.cs
- ChildrenQuery.cs
- SelectionRangeConverter.cs
- PageClientProxyGenerator.cs
- PenLineJoinValidation.cs
- Property.cs
- XmlValidatingReader.cs
- cache.cs
- Utils.cs
- DataListItemCollection.cs
- TransactedBatchingBehavior.cs
- AttributeCollection.cs
- XPathMultyIterator.cs
- ItemContainerPattern.cs
- TableNameAttribute.cs
- TextTreeText.cs
- DataRelationPropertyDescriptor.cs
- SafePointer.cs
- CodeDelegateCreateExpression.cs
- QfeChecker.cs
- UnitySerializationHolder.cs
- Action.cs
- ToolboxComponentsCreatedEventArgs.cs
- ConfigurationStrings.cs
- OleTxTransaction.cs
- SqlConnectionFactory.cs
- URLBuilder.cs
- XmlReturnWriter.cs
- DbConnectionClosed.cs
- ListViewGroupItemCollection.cs
- Matrix3DStack.cs
- ServiceDocument.cs
- ProcessProtocolHandler.cs
- ConnectionPool.cs
- SqlNotificationEventArgs.cs
- FillErrorEventArgs.cs
- PermissionSet.cs
- ObjectConverter.cs
- NameObjectCollectionBase.cs
- _NegotiateClient.cs
- RuntimeEnvironment.cs
- RuntimeVariablesExpression.cs
- TableLayoutPanelCodeDomSerializer.cs
- SqlRowUpdatingEvent.cs
- CfgSemanticTag.cs
- ScopelessEnumAttribute.cs
- FileEnumerator.cs
- CurrentTimeZone.cs
- AuthenticationService.cs
- SystemException.cs
- FamilyCollection.cs
- AvTraceDetails.cs
- PathGeometry.cs
- CharConverter.cs
- ColorTranslator.cs
- HiddenField.cs
- X509Utils.cs
- RegisteredScript.cs
- WSDualHttpSecurityElement.cs
- ArcSegment.cs
- PropertyManager.cs
- CompositeKey.cs
- DesignerDataParameter.cs
- MetadataUtil.cs
- QueryTask.cs
- X509CertificateTrustedIssuerElement.cs
- OracleInternalConnection.cs
- DataGridViewCellLinkedList.cs
- _AcceptOverlappedAsyncResult.cs
- DataGridViewDataErrorEventArgs.cs
- DataGridViewColumnHeaderCell.cs
- FontClient.cs
- NativeMethods.cs