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
- StreamingContext.cs
- MailAddressCollection.cs
- TimeEnumHelper.cs
- WaitingCursor.cs
- InputProviderSite.cs
- SoapSchemaMember.cs
- ValueType.cs
- MessageEventSubscriptionService.cs
- XmlSignificantWhitespace.cs
- SchemaSetCompiler.cs
- RawStylusSystemGestureInputReport.cs
- DSACryptoServiceProvider.cs
- ObjectViewFactory.cs
- WebDisplayNameAttribute.cs
- AuthorizationContext.cs
- ReferenceEqualityComparer.cs
- AttributeCollection.cs
- AlphabeticalEnumConverter.cs
- HandledEventArgs.cs
- UpdatePanelTrigger.cs
- CipherData.cs
- TitleStyle.cs
- ReferenceTypeElement.cs
- PointF.cs
- XmlReflectionMember.cs
- PropertyInformationCollection.cs
- SqlParameterCollection.cs
- URIFormatException.cs
- TextEditorDragDrop.cs
- BufferedGraphics.cs
- WebPartTransformerAttribute.cs
- PreloadHost.cs
- HttpCachePolicy.cs
- DocumentPage.cs
- ChtmlCalendarAdapter.cs
- EncryptedPackageFilter.cs
- FlowLayoutSettings.cs
- MetadataCache.cs
- ControlPropertyNameConverter.cs
- VirtualPathProvider.cs
- MenuStrip.cs
- ReflectionPermission.cs
- HtmlLinkAdapter.cs
- DataControlFieldHeaderCell.cs
- DataGridViewCellLinkedList.cs
- DocumentGridContextMenu.cs
- TableItemProviderWrapper.cs
- XmlSchemaInclude.cs
- UpdateException.cs
- MappingMetadataHelper.cs
- Publisher.cs
- PageAdapter.cs
- RuntimeHelpers.cs
- DbXmlEnabledProviderManifest.cs
- WpfKnownTypeInvoker.cs
- CodeGeneratorOptions.cs
- ScriptReferenceBase.cs
- RectConverter.cs
- BooleanKeyFrameCollection.cs
- ThreadPool.cs
- AncestorChangedEventArgs.cs
- LabelEditEvent.cs
- QueryOutputWriter.cs
- PermissionSetEnumerator.cs
- NetStream.cs
- ListBoxChrome.cs
- OperationDescriptionCollection.cs
- CompressStream.cs
- InputLanguageEventArgs.cs
- CommandValueSerializer.cs
- ExtractedStateEntry.cs
- FtpRequestCacheValidator.cs
- XmlBoundElement.cs
- NetSectionGroup.cs
- Expression.cs
- FlowLayout.cs
- RestHandler.cs
- TraceListener.cs
- DataSetMappper.cs
- x509store.cs
- precedingsibling.cs
- Matrix3DStack.cs
- SingleResultAttribute.cs
- XamlReaderHelper.cs
- Point.cs
- BitmapEffectState.cs
- CharUnicodeInfo.cs
- StylusDownEventArgs.cs
- ConnectionPoolManager.cs
- ScriptingWebServicesSectionGroup.cs
- SyncMethodInvoker.cs
- ImageButton.cs
- xdrvalidator.cs
- SuspendDesigner.cs
- HtmlImage.cs
- DetailsViewInsertEventArgs.cs
- SqlDependencyUtils.cs
- XmlJsonReader.cs
- AsyncOperationManager.cs
- DesignerWebPartChrome.cs