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
- WindowExtensionMethods.cs
- ObjectStateManagerMetadata.cs
- ToolStripItemClickedEventArgs.cs
- X509CertificateChain.cs
- __TransparentProxy.cs
- HebrewNumber.cs
- MessageSmuggler.cs
- SHA384Cng.cs
- CFStream.cs
- NamedPipeTransportManager.cs
- ElementsClipboardData.cs
- TypeConverter.cs
- IteratorFilter.cs
- DataServiceContext.cs
- Point4D.cs
- RequestCachePolicyConverter.cs
- FixedHighlight.cs
- TracingConnectionListener.cs
- SafeNativeMethods.cs
- RegularExpressionValidator.cs
- WpfKnownMemberInvoker.cs
- SelectedCellsCollection.cs
- ZipFileInfoCollection.cs
- RelationshipEndMember.cs
- Calendar.cs
- DataTableMapping.cs
- FormatConvertedBitmap.cs
- Point3DAnimation.cs
- InputLanguageCollection.cs
- NetworkInformationException.cs
- FixUp.cs
- DataBindingCollection.cs
- BamlRecordWriter.cs
- XhtmlBasicValidatorAdapter.cs
- XmlAttributeOverrides.cs
- SafeEventLogReadHandle.cs
- RawStylusSystemGestureInputReport.cs
- CloudCollection.cs
- DynamicDataManager.cs
- XmlSecureResolver.cs
- IsolatedStorage.cs
- GlyphRunDrawing.cs
- MultipleViewProviderWrapper.cs
- Grid.cs
- DataSourceControlBuilder.cs
- InkCanvasSelection.cs
- QueryExecutionOption.cs
- Empty.cs
- BitmapEffectRenderDataResource.cs
- Validator.cs
- Dictionary.cs
- ConstNode.cs
- CharacterMetricsDictionary.cs
- WorkflowTransactionService.cs
- PerformanceCounterPermissionEntryCollection.cs
- SupportingTokenAuthenticatorSpecification.cs
- InheritanceAttribute.cs
- Propagator.ExtentPlaceholderCreator.cs
- MulticastOption.cs
- BitmapMetadata.cs
- TextWriter.cs
- FormDesigner.cs
- TextFormatterHost.cs
- OleDbConnectionInternal.cs
- XLinq.cs
- CompositeFontInfo.cs
- InstanceLockTracking.cs
- ViewStateModeByIdAttribute.cs
- TimelineGroup.cs
- _SingleItemRequestCache.cs
- SponsorHelper.cs
- StackBuilderSink.cs
- ItemType.cs
- GeneralTransform3DTo2D.cs
- AlternationConverter.cs
- WorkItem.cs
- MsmqIntegrationReceiveParameters.cs
- BinaryObjectReader.cs
- ChannelServices.cs
- Guid.cs
- SeekableReadStream.cs
- ParentControlDesigner.cs
- PassportAuthentication.cs
- DateBoldEvent.cs
- SQLBoolean.cs
- FilterableAttribute.cs
- TextEndOfParagraph.cs
- DelegateHelpers.cs
- AttributeQuery.cs
- LoadedEvent.cs
- XmlHierarchicalEnumerable.cs
- GetMemberBinder.cs
- M3DUtil.cs
- DesignConnectionCollection.cs
- TableItemPatternIdentifiers.cs
- BindingList.cs
- ZoomingMessageFilter.cs
- HebrewNumber.cs
- FixedDocumentPaginator.cs
- OpenTypeLayout.cs