Udostępnij za pośrednictwem


MessageQueuePermissionEntryCollection Klasa

Definicja

Zawiera silnie typizowane kolekcje MessageQueuePermissionEntry obiektów.

public ref class MessageQueuePermissionEntryCollection : System::Collections::CollectionBase
[System.Serializable]
public class MessageQueuePermissionEntryCollection : System.Collections.CollectionBase
[<System.Serializable>]
type MessageQueuePermissionEntryCollection = class
    inherit CollectionBase
Public Class MessageQueuePermissionEntryCollection
Inherits CollectionBase
Dziedziczenie
MessageQueuePermissionEntryCollection
Atrybuty

Przykłady

W poniższym przykładzie kodu pokazano użycie metody MessageQueuePermissionEntryCollection.


#using <System.Messaging.dll>
#using <System.dll>
using namespace System;
using namespace System::Messaging;

public ref class MessageQueuePermissionEntryCollectionExample
{
    // Demonstrates:
    // public Int32 Add (MessageQueuePermissionEntry value)
public:
    void AddExample()
    {
        // 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);

        queue->Close();
    }

    // Demonstrates:
    // public Void AddRange (MessageQueuePermissionEntry[] value)
public:
    void AddRangeExample1()
    {
        // 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 an array of type MessageQueuePermissionEntry.
        array<MessageQueuePermissionEntry^>^ entries = 
            gcnew array<MessageQueuePermissionEntry^>(1);

        // Create a new instance of MessageQueuePermissionEntry and place the
        // instance in the array.
        entries[0] = gcnew MessageQueuePermissionEntry(
            MessageQueuePermissionAccess::Receive, 
            queue->MachineName, 
            queue->Label, 
            queue->Category.ToString());

        // Add the array to the collection.
        collection->AddRange(entries);

        queue->Close();
    }

    // Demonstrates:
    // public Void AddRange (MessageQueuePermissionEntryCollection value)
public:
    void AddRangeExample2()
    {
        // Connect to a queue on the local computer.
        MessageQueue^ queue = gcnew MessageQueue(".\\exampleQueue");

        // Create a new instance of MessageQueuePermission.
        MessageQueuePermission^ permission = gcnew MessageQueuePermission();

        // Create a new instance of MessageQueuePermissionEntry.
        MessageQueuePermissionEntry^ entry = gcnew MessageQueuePermissionEntry(
            MessageQueuePermissionAccess::Receive, 
            queue->MachineName, 
            queue->Label, queue->Category.ToString());

        // Add the entry to the permission's collection.
        permission->PermissionEntries->Add(entry);

        // Create another new instance of MessageQueuePermission.
        MessageQueuePermission^ newPermission = gcnew MessageQueuePermission();

        // Use AddRange() to append the original permission's collection to the
        // new permission's collection.
        newPermission->PermissionEntries->AddRange(
            permission->PermissionEntries);

        // To show that AddRange() copies collections by value and not by
        // reference, we'll clear the original permission's collection, then
        // display a count of how many entries are in the original permission's
        // collection and how many entries are in the new permission's
        // collection.

        // Clear the original permission's collection.
        permission->PermissionEntries->Clear();

        // The original permission now contains 0 entries, but the new
        // permission still contains 1 entry.
        Console::WriteLine("Original permission contains {0} entries.",
            permission->PermissionEntries->Count);
        Console::WriteLine("New permission contains {0} entries.",
            newPermission->PermissionEntries->Count);

        queue->Close();
    }

    // Demonstrates:
    // public Boolean Contains (MessageQueuePermissionEntry value)
public:
    void ContainsExample()
    {
        // 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();
    }

    // Demonstrates:
    // public Void CopyTo (MessageQueuePermissionEntry[] array, Int32 index)
public:
    void CopyToExample()
    {
        // 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);

        // Create an array of type MessageQueuePermissionEntry.
        array<MessageQueuePermissionEntry^>^ entries = 
            gcnew array<MessageQueuePermissionEntry^>(1);

        // Copy the collection to index 0 of the array.
        collection->CopyTo(entries, 0);

        // Show that the array now contains the entry.
        Console::WriteLine("entries[0].PermissionAccess: {0}",
            entries[0]->PermissionAccess);
        Console::WriteLine("entries[0].MachineName: {0}",
            entries[0]->MachineName);
        Console::WriteLine("entries[0].Label: {0}", entries[0]->Label);
        Console::WriteLine("entries[0].Category: {0}",
            entries[0]->Category);

        queue->Close();
    }

    // Demonstrates:
    // public Int32 IndexOf (MessageQueuePermissionEntry value)
public:
    void IndexOfExample()
    {
        // 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();
    }

    // Demonstrates:
    // public Void Insert (Int32 index, MessageQueuePermissionEntry value)
public:
    void InsertExample()
    {
        // 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);

        // Create another new instance of MessageQueuePermissionEntry.
        MessageQueuePermissionEntry^ newEntry = 
            gcnew MessageQueuePermissionEntry(
            MessageQueuePermissionAccess::Send, 
            queue->MachineName, 
            queue->Label, 
            queue->Category.ToString());

        // Insert the new entry into the collection before the original entry.
        collection->Insert(0, newEntry);

        queue->Close();
    }

    // Demonstrates:
    // public MessageQueuePermissionEntry Item [Int32 index] { get; set; }
public:
    void ItemExample()
    {
        // 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 entry's properties, using the collection's Item
        // accessor.
        Console::WriteLine("collection[0].PermissionAccess: {0}",
            collection[0]->PermissionAccess);
        Console::WriteLine("collection[0].MachineName: {0}",
            collection[0]->MachineName);
        Console::WriteLine("collection[0].Label: {0}", collection[0]->Label);
        Console::WriteLine("collection[0].Category: {0}",
            collection[0]->Category);

        queue->Close();
    }

    // Demonstrates:
    // public Void Remove (MessageQueuePermissionEntry value)
public:
    void RemoveExample()
    {
        // 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);

        // Remove the entry from the collection.
        collection->Remove(entry);

        queue->Close();
    }
};

// Creates a new queue.
void CreateQueue(String^ queuePath, bool transactional)
{
    if (!MessageQueue::Exists(queuePath))
    {
        MessageQueue^ queue = MessageQueue::Create(queuePath, transactional);
        queue->Close();      
    }
    else
    {
        Console::WriteLine("{0} already exists.", queuePath);
    }
}

int main()
{
    // Create a new instance of the class.
    MessageQueuePermissionEntryCollectionExample^ example =
        gcnew MessageQueuePermissionEntryCollectionExample();

    // Create a non-transactional queue on the local computer.
    CreateQueue(".\\exampleQueue", false);

    // Demonstrate MessageQueuePermissionEntryCollection's members.
    example->AddExample();
    example->AddRangeExample1();
    example->AddRangeExample2();
    example->ContainsExample();
    example->CopyToExample();
    example->IndexOfExample();
    example->InsertExample();
    example->ItemExample();
    example->RemoveExample();
}

using System;
using System.Messaging;

public class MessageQueuePermissionEntryCollectionExample
{
    public static void Main()
    {
        // Create a new instance of the class.
        MessageQueuePermissionEntryCollectionExample example =
            new MessageQueuePermissionEntryCollectionExample();

        // Create a non-transactional queue on the local computer.
        CreateQueue(".\\exampleQueue", false);

        // Demonstrate MessageQueuePermissionEntryCollection's members.
        example.AddExample();
        example.AddRangeExample1();
        example.AddRangeExample2();
        example.ContainsExample();
        example.CopyToExample();
        example.IndexOfExample();
        example.InsertExample();
        example.ItemExample();
        example.RemoveExample();
    }

    // Creates a new queue.
    public static void CreateQueue(string queuePath, bool transactional)
    {
        if(!MessageQueue.Exists(queuePath))
        {
            MessageQueue.Create(queuePath, transactional);
        }
        else
        {
            Console.WriteLine(queuePath + " already exists.");
        }
    }

    // Demonstrates:
    // public Int32 Add (MessageQueuePermissionEntry value)
    public void AddExample()
    {
        // Connect to a queue on the local computer.
        MessageQueue queue = new MessageQueue(".\\exampleQueue");

        // Create a new instance of MessageQueuePermission.
        MessageQueuePermission permission = new MessageQueuePermission();

        // Get an instance of MessageQueuePermissionEntryCollection from the
        // permission's PermissionEntries property.
        MessageQueuePermissionEntryCollection collection =
            permission.PermissionEntries;

        // Create a new instance of MessageQueuePermissionEntry.
        MessageQueuePermissionEntry entry = new MessageQueuePermissionEntry(
            MessageQueuePermissionAccess.Receive,
            queue.MachineName,
            queue.Label,
            queue.Category.ToString());

        // Add the entry to the collection.
        collection.Add(entry);
    }

    // Demonstrates:
    // public Void AddRange (MessageQueuePermissionEntry[] value)
    public void AddRangeExample1()
    {
        // Connect to a queue on the local computer.
        MessageQueue queue = new MessageQueue(".\\exampleQueue");

        // Create a new instance of MessageQueuePermission.
        MessageQueuePermission permission = new MessageQueuePermission();

        // Get an instance of MessageQueuePermissionEntryCollection from the
        // permission's PermissionEntries property.
        MessageQueuePermissionEntryCollection collection =
            permission.PermissionEntries;

        // Create an array of type MessageQueuePermissionEntry.
        MessageQueuePermissionEntry[] entries =
            new MessageQueuePermissionEntry[1];

        // Create a new instance of MessageQueuePermissionEntry and place the
        // instance in the array.
        entries[0] = new MessageQueuePermissionEntry(
            MessageQueuePermissionAccess.Receive,
            queue.MachineName,
            queue.Label,
            queue.Category.ToString());

        // Add the array to the collection.
        collection.AddRange(entries);
    }

    // Demonstrates:
    // public Void AddRange (MessageQueuePermissionEntryCollection value)
    public void AddRangeExample2()
    {
        // Connect to a queue on the local computer.
        MessageQueue queue = new MessageQueue(".\\exampleQueue");

        // Create a new instance of MessageQueuePermission.
        MessageQueuePermission permission = new MessageQueuePermission();

        // Create a new instance of MessageQueuePermissionEntry.
        MessageQueuePermissionEntry entry = new MessageQueuePermissionEntry(
            MessageQueuePermissionAccess.Receive,
            queue.MachineName,
            queue.Label,
            queue.Category.ToString());

        // Add the entry to the permission's collection.
        permission.PermissionEntries.Add(entry);

        // Create another new instance of MessageQueuePermission.
        MessageQueuePermission newPermission = new MessageQueuePermission();

        // Use AddRange() to append the original permission's collection to the
        // new permission's collection.
        newPermission.PermissionEntries.AddRange(permission.PermissionEntries);

        // To show that AddRange() copies collections by value and not by
        // reference, we'll clear the original permission's collection, then
        // display a count of how many entries are in the original permission's
        // collection and how many entries are in the new permission's
        // collection.

        // Clear the original permission's collection.
        permission.PermissionEntries.Clear();

        // The original permission now contains 0 entries, but the new
        // permission still contains 1 entry.
        Console.WriteLine("Original permission contains {0} entries.",
            permission.PermissionEntries.Count);
        Console.WriteLine("New permission contains {0} entries.",
            newPermission.PermissionEntries.Count);
    }

    // Demonstrates:
    // public Boolean Contains (MessageQueuePermissionEntry value)
    public void ContainsExample()
    {
        // Connect to a queue on the local computer.
        MessageQueue queue = new MessageQueue(".\\exampleQueue");

        // Create a new instance of MessageQueuePermission.
        MessageQueuePermission permission = new MessageQueuePermission();

        // Get an instance of MessageQueuePermissionEntryCollection from the
        // permission's PermissionEntries property.
        MessageQueuePermissionEntryCollection collection =
            permission.PermissionEntries;

        // Create a new instance of MessageQueuePermissionEntry.
        MessageQueuePermissionEntry entry = new 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 = new 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));
    }

    // Demonstrates:
    // public Void CopyTo (MessageQueuePermissionEntry[] array, Int32 index)
    public void CopyToExample()
    {
        // Connect to a queue on the local computer.
        MessageQueue queue = new MessageQueue(".\\exampleQueue");

        // Create a new instance of MessageQueuePermission.
        MessageQueuePermission permission = new MessageQueuePermission();

        // Get an instance of MessageQueuePermissionEntryCollection from the
        // permission's PermissionEntries property.
        MessageQueuePermissionEntryCollection collection =
            permission.PermissionEntries;

        // Create a new instance of MessageQueuePermissionEntry.
        MessageQueuePermissionEntry entry = new MessageQueuePermissionEntry(
            MessageQueuePermissionAccess.Receive,
            queue.MachineName,
            queue.Label,
            queue.Category.ToString());

        // Add the entry to the collection.
        collection.Add(entry);

        // Create an array of type MessageQueuePermissionEntry.
        MessageQueuePermissionEntry[] entries =
            new MessageQueuePermissionEntry[1];

        // Copy the collection to index 0 of the array.
        collection.CopyTo(entries, 0);

        // Show that the array now contains the entry.
        Console.WriteLine("entries[0].PermissionAccess: {0}",
            entries[0].PermissionAccess);
        Console.WriteLine("entries[0].MachineName: {0}",
            entries[0].MachineName);
        Console.WriteLine("entries[0].Label: {0}", entries[0].Label);
        Console.WriteLine("entries[0].Category: {0}",
            entries[0].Category.ToString());
    }

    // Demonstrates:
    // public Int32 IndexOf (MessageQueuePermissionEntry value)
    public void IndexOfExample()
    {
        // Connect to a queue on the local computer.
        MessageQueue queue = new MessageQueue(".\\exampleQueue");

        // Create a new instance of MessageQueuePermission.
        MessageQueuePermission permission = new MessageQueuePermission();

        // Get an instance of MessageQueuePermissionEntryCollection from the
        // permission's PermissionEntries property.
        MessageQueuePermissionEntryCollection collection =
            permission.PermissionEntries;

        // Create a new instance of MessageQueuePermissionEntry.
        MessageQueuePermissionEntry entry = new 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));

    }

    // Demonstrates:
    // public Void Insert (Int32 index, MessageQueuePermissionEntry value)
    public void InsertExample()
    {
        // Connect to a queue on the local computer.
        MessageQueue queue = new MessageQueue(".\\exampleQueue");

        // Create a new instance of MessageQueuePermission.
        MessageQueuePermission permission = new MessageQueuePermission();

        // Get an instance of MessageQueuePermissionEntryCollection from the
        // permission's PermissionEntries property.
        MessageQueuePermissionEntryCollection collection =
            permission.PermissionEntries;

        // Create a new instance of MessageQueuePermissionEntry.
        MessageQueuePermissionEntry entry = new MessageQueuePermissionEntry(
            MessageQueuePermissionAccess.Receive,
            queue.MachineName,
            queue.Label,
            queue.Category.ToString());

        // Add the entry to the collection.
        collection.Add(entry);

        // Create another new instance of MessageQueuePermissionEntry.
        MessageQueuePermissionEntry newEntry = new MessageQueuePermissionEntry(
            MessageQueuePermissionAccess.Send,
            queue.MachineName,
            queue.Label,
            queue.Category.ToString());

        // Insert the new entry into the collection before the original entry.
        collection.Insert(0, newEntry);
    }

    // Demonstrates:
    // public MessageQueuePermissionEntry Item [Int32 index] { get; set; }
    public void ItemExample()
    {
        // Connect to a queue on the local computer.
        MessageQueue queue = new MessageQueue(".\\exampleQueue");

        // Create a new instance of MessageQueuePermission.
        MessageQueuePermission permission = new MessageQueuePermission();

        // Get an instance of MessageQueuePermissionEntryCollection from the
        // permission's PermissionEntries property.
        MessageQueuePermissionEntryCollection collection =
            permission.PermissionEntries;

        // Create a new instance of MessageQueuePermissionEntry.
        MessageQueuePermissionEntry entry = new MessageQueuePermissionEntry(
            MessageQueuePermissionAccess.Receive,
            queue.MachineName,
            queue.Label,
            queue.Category.ToString());

        // Add the entry to the collection.
        collection.Add(entry);

        // Display the entry's properties, using the collection's Item
        // accessor.
        Console.WriteLine("collection[0].PermissionAccess: {0}",
            collection[0].PermissionAccess);
        Console.WriteLine("collection[0].MachineName: {0}",
            collection[0].MachineName);
        Console.WriteLine("collection[0].Label: {0}", collection[0].Label);
        Console.WriteLine("collection[0].Category: {0}",
            collection[0].Category.ToString());

    }

    // Demonstrates:
    // public Void Remove (MessageQueuePermissionEntry value)
    public void RemoveExample()
    {
        // Connect to a queue on the local computer.
        MessageQueue queue = new MessageQueue(".\\exampleQueue");

        // Create a new instance of MessageQueuePermission.
        MessageQueuePermission permission = new MessageQueuePermission();

        // Get an instance of MessageQueuePermissionEntryCollection from the
        // permission's PermissionEntries property.
        MessageQueuePermissionEntryCollection collection =
            permission.PermissionEntries;

        // Create a new instance of MessageQueuePermissionEntry.
        MessageQueuePermissionEntry entry = new MessageQueuePermissionEntry(
            MessageQueuePermissionAccess.Receive,
            queue.MachineName,
            queue.Label,
            queue.Category.ToString());

        // Add the entry to the collection.
        collection.Add(entry);

        // Remove the entry from the collection.
        collection.Remove(entry);
    }
}

Właściwości

Capacity

Pobiera lub ustawia liczbę elementów, które CollectionBase mogą zawierać.

(Odziedziczone po CollectionBase)
Count

Pobiera liczbę elementów zawartych w wystąpieniu CollectionBase . Nie można zastąpić tej właściwości.

(Odziedziczone po CollectionBase)
InnerList

Pobiera element ArrayList zawierający listę elementów w wystąpieniu CollectionBase .

(Odziedziczone po CollectionBase)
Item[Int32]

Pobiera lub ustawia obiekt w określonym indeksie.

List

Pobiera element IList zawierający listę elementów w wystąpieniu CollectionBase .

(Odziedziczone po CollectionBase)

Metody

Add(MessageQueuePermissionEntry)

Dodaje określony MessageQueuePermissionEntry element do tej kolekcji.

AddRange(MessageQueuePermissionEntry[])

Dołącza zestaw określonych wpisów uprawnień do tej kolekcji.

AddRange(MessageQueuePermissionEntryCollection)

Dołącza zestaw określonych wpisów uprawnień do tej kolekcji.

Clear()

Usuwa wszystkie obiekty z CollectionBase wystąpienia. Nie można zastąpić tej metody.

(Odziedziczone po CollectionBase)
Contains(MessageQueuePermissionEntry)

Określa, czy ta kolekcja zawiera określony MessageQueuePermissionEntryelement .

CopyTo(MessageQueuePermissionEntry[], Int32)

Kopiuje wpisy uprawnień z tej kolekcji do tablicy, zaczynając od określonego indeksu tablicy.

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetEnumerator()

Zwraca moduł wyliczający, który iteruje za pośrednictwem CollectionBase wystąpienia.

(Odziedziczone po CollectionBase)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera bieżące wystąpienie.

(Odziedziczone po Object)
IndexOf(MessageQueuePermissionEntry)

Określa indeks określonego wpisu uprawnień w tej kolekcji.

Insert(Int32, MessageQueuePermissionEntry)

Wstawia wpis uprawnień do tej kolekcji w określonym indeksie.

MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
OnClear()

Wykonuje dodatkowe procesy niestandardowe po wyczyszczeniu zawartości kolekcji.

OnClearComplete()

Wykonuje dodatkowe procesy niestandardowe po wyczyszczeniu zawartości CollectionBase wystąpienia.

(Odziedziczone po CollectionBase)
OnInsert(Int32, Object)

Wykonuje dodatkowe procesy niestandardowe przed wstawieniem nowego wpisu uprawnień do kolekcji.

OnInsertComplete(Int32, Object)

Wykonuje dodatkowe procesy niestandardowe po wstawieniu nowego elementu do CollectionBase wystąpienia.

(Odziedziczone po CollectionBase)
OnRemove(Int32, Object)

Wykonuje dodatkowe procesy niestandardowe podczas usuwania nowego wpisu uprawnień z kolekcji.

OnRemoveComplete(Int32, Object)

Wykonuje dodatkowe procesy niestandardowe po usunięciu CollectionBase elementu z wystąpienia.

(Odziedziczone po CollectionBase)
OnSet(Int32, Object, Object)

Wykonuje dodatkowe procesy niestandardowe przed ustawieniem wartości w kolekcji.

OnSetComplete(Int32, Object, Object)

Wykonuje dodatkowe procesy niestandardowe po ustawieniu wartości w wystąpieniu CollectionBase .

(Odziedziczone po CollectionBase)
OnValidate(Object)

Wykonuje dodatkowe procesy niestandardowe podczas sprawdzania poprawności wartości.

(Odziedziczone po CollectionBase)
Remove(MessageQueuePermissionEntry)

Usuwa określony wpis uprawnień z tej kolekcji.

RemoveAt(Int32)

Usuwa element w określonym indeksie CollectionBase wystąpienia. Ta metoda nie jest zastępowana.

(Odziedziczone po CollectionBase)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Jawne implementacje interfejsu

ICollection.CopyTo(Array, Int32)

Kopiuje całą CollectionBase do zgodnej jednowymiarowej Arraytablicy, zaczynając od określonego indeksu tablicy docelowej.

(Odziedziczone po CollectionBase)
ICollection.IsSynchronized

Pobiera wartość wskazującą, czy dostęp do elementu CollectionBase jest synchronizowany (bezpieczny wątek).

(Odziedziczone po CollectionBase)
ICollection.SyncRoot

Pobiera obiekt, który może służyć do synchronizowania dostępu do obiektu CollectionBase.

(Odziedziczone po CollectionBase)
IList.Add(Object)

Dodaje obiekt na końcu obiektu CollectionBase.

(Odziedziczone po CollectionBase)
IList.Contains(Object)

Określa, czy element CollectionBase zawiera określony element.

(Odziedziczone po CollectionBase)
IList.IndexOf(Object)

Wyszukuje określony Object element i zwraca indeks oparty na zerowym pierwszym wystąpieniu w całym CollectionBaseobiekcie .

(Odziedziczone po CollectionBase)
IList.Insert(Int32, Object)

Wstawia element do CollectionBase określonego indeksu.

(Odziedziczone po CollectionBase)
IList.IsFixedSize

Pobiera wartość wskazującą, czy rozmiar CollectionBase ma stały rozmiar.

(Odziedziczone po CollectionBase)
IList.IsReadOnly

Pobiera wartość wskazującą, czy kolekcja CollectionBase jest przeznaczona tylko do odczytu.

(Odziedziczone po CollectionBase)
IList.Item[Int32]

Pobiera lub ustawia element pod określonym indeksem.

(Odziedziczone po CollectionBase)
IList.Remove(Object)

Usuwa pierwsze wystąpienie określonego obiektu z obiektu CollectionBase.

(Odziedziczone po CollectionBase)

Metody rozszerzania

Cast<TResult>(IEnumerable)

Rzutuje elementy elementu IEnumerable do określonego typu.

OfType<TResult>(IEnumerable)

Filtruje elementy elementu IEnumerable na podstawie określonego typu.

AsParallel(IEnumerable)

Umożliwia równoległość zapytania.

AsQueryable(IEnumerable)

Konwertuje element IEnumerable na .IQueryable

Dotyczy

Zobacz też