MessageQueuePermissionEntryCollection Classe

Definizione

Contiene una raccolta fortemente tipizzata di oggetti MessageQueuePermissionEntry.

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
Ereditarietà
MessageQueuePermissionEntryCollection
Attributi

Esempio

L'esempio di codice seguente illustra l'uso di 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);
    }
}

Proprietà

Capacity

Ottiene o imposta il numero di elementi che CollectionBase può contenere.

(Ereditato da CollectionBase)
Count

Ottiene il numero di elementi contenuti nell'istanza di CollectionBase. Questa proprietà non può essere sottoposta a override.

(Ereditato da CollectionBase)
InnerList

Ottiene un ArrayList contenente l'elenco degli elementi presenti nell'istanza CollectionBase.

(Ereditato da CollectionBase)
Item[Int32]

Ottiene o imposta l'oggetto in corrispondenza dell'indice specificato.

List

Ottiene un IList contenente l'elenco degli elementi presenti nell'istanza CollectionBase.

(Ereditato da CollectionBase)

Metodi

Add(MessageQueuePermissionEntry)

Aggiunge un oggetto MessageQueuePermissionEntry specificato all'insieme.

AddRange(MessageQueuePermissionEntry[])

Aggiunge un gruppo di voci di autorizzazione specificate all'insieme.

AddRange(MessageQueuePermissionEntryCollection)

Aggiunge un gruppo di voci di autorizzazione specificate all'insieme.

Clear()

Consente di rimuovere tutti gli oggetti dall'istanza CollectionBase. Questo metodo non può essere sottoposto a override.

(Ereditato da CollectionBase)
Contains(MessageQueuePermissionEntry)

Determina se l’insieme contiene una MessageQueuePermissionEntry specificata.

CopyTo(MessageQueuePermissionEntry[], Int32)

Copia le voci di autorizzazione di questo insieme in una matrice, a partire da un determinato indice della matrice.

Equals(Object)

Determina se l'oggetto specificato è uguale all'oggetto corrente.

(Ereditato da Object)
GetEnumerator()

Restituisce un enumeratore per lo scorrimento dell'istanza di CollectionBase.

(Ereditato da CollectionBase)
GetHashCode()

Funge da funzione hash predefinita.

(Ereditato da Object)
GetType()

Ottiene l'oggetto Type dell'istanza corrente.

(Ereditato da Object)
IndexOf(MessageQueuePermissionEntry)

Determina l'indice di una voce di autorizzazione specificata nell'insieme.

Insert(Int32, MessageQueuePermissionEntry)

Inserisce una voce di autorizzazione nell'insieme, in corrispondenza dell'indice specificato.

MemberwiseClone()

Crea una copia superficiale dell'oggetto Object corrente.

(Ereditato da Object)
OnClear()

Consente di eseguire processi personalizzati aggiuntivi dopo la cancellazione del contenuto dell'insieme.

OnClearComplete()

Esegue procedure personalizzate aggiuntive prima di cancellare il contenuto dell'istanza di CollectionBase.

(Ereditato da CollectionBase)
OnInsert(Int32, Object)

Consente di eseguire processi personalizzati aggiuntivi prima dell'inserimento di una nuova voce di autorizzazione nell'insieme.

OnInsertComplete(Int32, Object)

Esegue procedure personalizzate aggiuntive dopo aver inserito un nuovo elemento nell'istanza di CollectionBase.

(Ereditato da CollectionBase)
OnRemove(Int32, Object)

Consente di eseguire processi personalizzati aggiuntivi durante la rimozione di una nuova voce di autorizzazione dall'insieme.

OnRemoveComplete(Int32, Object)

Esegue procedure personalizzate aggiuntive dopo della rimozione di un elemento dall'istanza di CollectionBase.

(Ereditato da CollectionBase)
OnSet(Int32, Object, Object)

Consente di eseguire processi personalizzati aggiuntivi prima di impostare un valore nell'insieme.

OnSetComplete(Int32, Object, Object)

Esegue procedure personalizzate aggiuntive dopo aver impostato un valore nell'istanza di CollectionBase.

(Ereditato da CollectionBase)
OnValidate(Object)

Esegue processi personalizzati aggiuntivi durante la convalida di un valore.

(Ereditato da CollectionBase)
Remove(MessageQueuePermissionEntry)

Rimuove dall'insieme la voce di autorizzazione specificata.

RemoveAt(Int32)

Consente di rimuovere la voce in corrispondenza dell'indice specificato dell'istanza CollectionBase. Questo metodo non può essere sottoposto a override.

(Ereditato da CollectionBase)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Implementazioni dell'interfaccia esplicita

ICollection.CopyTo(Array, Int32)

Copia l'intero oggetto CollectionBase in un oggetto Array compatibile unidimensionale, a partire dall'indice specificato della matrice di destinazione.

(Ereditato da CollectionBase)
ICollection.IsSynchronized

Ottiene un valore che indica se l'accesso a CollectionBase è sincronizzato (thread-safe).

(Ereditato da CollectionBase)
ICollection.SyncRoot

Ottiene un oggetto che può essere usato per sincronizzare l'accesso a CollectionBase.

(Ereditato da CollectionBase)
IList.Add(Object)

Aggiunge un oggetto alla fine di CollectionBase.

(Ereditato da CollectionBase)
IList.Contains(Object)

Consente di stabilire se CollectionBase contiene un elemento specifico.

(Ereditato da CollectionBase)
IList.IndexOf(Object)

Cerca l'oggetto Object specificato e restituisce l'indice in base zero della prima occorrenza all'interno dell'intero CollectionBase.

(Ereditato da CollectionBase)
IList.Insert(Int32, Object)

Inserisce un elemento in CollectionBase in corrispondenza dell'indice specificato.

(Ereditato da CollectionBase)
IList.IsFixedSize

Ottiene un valore che indica se CollectionBase ha dimensioni fisse.

(Ereditato da CollectionBase)
IList.IsReadOnly

Ottiene un valore che indica se CollectionBase è di sola lettura.

(Ereditato da CollectionBase)
IList.Item[Int32]

Ottiene o imposta l'elemento in corrispondenza dell'indice specificato.

(Ereditato da CollectionBase)
IList.Remove(Object)

Rimuove la prima occorrenza di un oggetto specifico da CollectionBase.

(Ereditato da CollectionBase)

Metodi di estensione

Cast<TResult>(IEnumerable)

Esegue il cast degli elementi di un oggetto IEnumerable nel tipo specificato.

OfType<TResult>(IEnumerable)

Filtra gli elementi di un oggetto IEnumerable in base a un tipo specificato.

AsParallel(IEnumerable)

Consente la parallelizzazione di una query.

AsQueryable(IEnumerable)

Converte un oggetto IEnumerable in un oggetto IQueryable.

Si applica a

Vedi anche