Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

PeerCollaboration.GetLocalRegisteredApplications Method

Gets a collection of PeerApplication objects that are registered on the local machine.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method Static member GetLocalRegisteredApplications() Gets all PeerApplication objects that are registered on the local machine.
Public method Static member GetLocalRegisteredApplications(PeerApplicationRegistrationType) Gets a collection of all PeerApplication objects that are registered on the local machine for the specified PeerApplicationRegistrationType.
Top

The caller required to sign in to the peer collaboration infrastructure via the SignIn method or prior to the use of this method.

Access to this property requires a PermissionState of Unrestricted. This state is created when the Peer collaboration session begins.

The following example code illustrates how to retrieve a collection of applications registered with the Collaboration infrastructure:

// Enumerating all local registered applications. 
private static void EnumLocalRegisteredApplications()
{
    PeerApplicationCollection pac = null;
    Console.WriteLine("Attempting to enumerate all local registered collaboration applications...");
    try
    {
        pac = PeerCollaboration.GetLocalRegisteredApplications(PeerApplicationRegistrationType.AllUsers);
        foreach (PeerApplication pa in pac)
        {
            Console.WriteLine("Registered application:\n ID: {0}\n Description: {1}\n", pa.Id, pa.Description);
        }
    }
    catch (PeerToPeerException p2pEx)
    {
        Console.WriteLine("The Peer Collaboration Infrastructure could not return an enumeration of the registered applications: {0}", 
            p2pEx.Message);
    }
    catch (Exception ex)
    {
        Console.WriteLine("Unexpected exception caught when trying to enumerate the registered collaboration applications: {0}.", 
            ex.Message);
    }
    finally
    {
        foreach (PeerApplication pa in pac)
        {
            pa.Dispose();
        }
    }
    return;
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.