The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
MessageQueuePermissionEntryCollection::Contains Method (MessageQueuePermissionEntry^)
.NET Framework (current version)
Determines whether this collection contains a specified MessageQueuePermissionEntry.
Assembly: System.Messaging (in System.Messaging.dll)
Parameters
- value
-
Type:
System.Messaging::MessageQueuePermissionEntry^
The MessageQueuePermissionEntry to find.
Return Value
Type: System::Booleantrue if the specified MessageQueuePermissionEntry belongs to this collection; otherwise, false.
The following code example demonstrates the use of Contains.
// Connect to a queue on the local computer. MessageQueue^ queue = gcnew MessageQueue(".\\exampleQueue"); // Create a new instance of MessageQueuePermission. MessageQueuePermission^ permission = gcnew MessageQueuePermission(); // Get an instance of MessageQueuePermissionEntryCollection from the // permission's PermissionEntries property. MessageQueuePermissionEntryCollection^ collection = permission->PermissionEntries; // Create a new instance of MessageQueuePermissionEntry. MessageQueuePermissionEntry^ entry = gcnew MessageQueuePermissionEntry( MessageQueuePermissionAccess::Receive, queue->MachineName, queue->Label, queue->Category.ToString()); // Add the entry to the collection. collection->Add(entry); // Show that the collection contains the entry. Console::WriteLine("Collection contains first entry (true/false): {0}", collection->Contains(entry)); // Create another new instance of MessageQueuePermissionEntry. MessageQueuePermissionEntry^ newEntry = gcnew MessageQueuePermissionEntry( MessageQueuePermissionAccess::Send, queue->MachineName, queue->Label, queue->Category.ToString()); // Show that the collection does not contain the new entry. Console::WriteLine( "Collection contains second entry (true/false): {0}", collection->Contains(newEntry)); queue->Close();
.NET Framework
Available since 1.1
Available since 1.1
Show: