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
- IDispatchConstantAttribute.cs
- XmlNamedNodeMap.cs
- TcpHostedTransportConfiguration.cs
- WebRequestModuleElement.cs
- DbModificationClause.cs
- SqlNode.cs
- TcpActivation.cs
- PipelineModuleStepContainer.cs
- Encoder.cs
- GridViewColumnHeaderAutomationPeer.cs
- HuffmanTree.cs
- HeaderedContentControl.cs
- AsyncStreamReader.cs
- ApplicationGesture.cs
- SpotLight.cs
- ISAPIRuntime.cs
- SoapFault.cs
- URLIdentityPermission.cs
- TreeNodeStyleCollectionEditor.cs
- EventlogProvider.cs
- ExternalCalls.cs
- ProvidePropertyAttribute.cs
- GroupBox.cs
- _ProxyRegBlob.cs
- SHA512.cs
- SqlFlattener.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- OperationValidationEventArgs.cs
- TemplateInstanceAttribute.cs
- PointIndependentAnimationStorage.cs
- FormViewInsertedEventArgs.cs
- WhileDesigner.cs
- BooleanSwitch.cs
- TaskSchedulerException.cs
- _FtpControlStream.cs
- Color.cs
- TrustVersion.cs
- StreamUpdate.cs
- EventSinkHelperWriter.cs
- WebPartConnectionsDisconnectVerb.cs
- RoleManagerSection.cs
- TrustManagerPromptUI.cs
- RegexCaptureCollection.cs
- ExpressionBuilder.cs
- TreeViewImageIndexConverter.cs
- DefaultTextStoreTextComposition.cs
- PointKeyFrameCollection.cs
- EntityStoreSchemaGenerator.cs
- SystemException.cs
- CompilerResults.cs
- IBuiltInEvidence.cs
- PageWrapper.cs
- ReadWriteObjectLock.cs
- ProviderCommandInfoUtils.cs
- OdbcConnectionFactory.cs
- RotateTransform.cs
- MiniModule.cs
- ObjectDataSourceView.cs
- ProxyDataContractResolver.cs
- CollectionChange.cs
- WorkflowApplication.cs
- BuildProviderAppliesToAttribute.cs
- TableAdapterManagerGenerator.cs
- DependencyObjectPropertyDescriptor.cs
- Pair.cs
- ComponentSerializationService.cs
- IPAddress.cs
- NameTable.cs
- Figure.cs
- PageContent.cs
- ReadOnlyNameValueCollection.cs
- DbgCompiler.cs
- AspCompat.cs
- SystemWebCachingSectionGroup.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- DbProviderManifest.cs
- UserControlDesigner.cs
- PiiTraceSource.cs
- SQLRoleProvider.cs
- TextRangeProviderWrapper.cs
- VoiceInfo.cs
- ControlIdConverter.cs
- BindingContext.cs
- RequestedSignatureDialog.cs
- ColumnCollection.cs
- BaseParaClient.cs
- FileUtil.cs
- BamlRecordHelper.cs
- FactoryGenerator.cs
- XmlEventCache.cs
- MobileRedirect.cs
- FixedStringLookup.cs
- XmlSerializerAssemblyAttribute.cs
- COM2Enum.cs
- XComponentModel.cs
- CriticalExceptions.cs
- SystemIPInterfaceProperties.cs
- FontInfo.cs
- ResourcesBuildProvider.cs
- HwndAppCommandInputProvider.cs