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::IndexOf Method (MessageQueuePermissionEntry^)
.NET Framework (current version)
Determines the index of a specified permission entry in this collection.
Assembly: System.Messaging (in System.Messaging.dll)
Parameters
- value
-
Type:
System.Messaging::MessageQueuePermissionEntry^
The permission entry to search for.
Return Value
Type: System::Int32The zero-based index of the specified permission entry, or -1 if the permission entry was not found in the collection.
The following code example demonstrates the use of IndexOf.
// 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); // Display the index of the entry in the collection. Console::WriteLine("Collection contains entry at index: {0}", collection->IndexOf(entry)); queue->Close();
.NET Framework
Available since 1.1
Available since 1.1
Show: