SmartFoxServer Silverlight API
GetBuddyById Method (id)
Namespaces ► SmartFoxClientAPI ► SmartFoxClient ► GetBuddyById(Int32)
Get a buddy from the buddy list, using the user id as key.
Refer to the buddyList property for a description of the buddy object's properties.
Declaration Syntax

C# | Visual Basic | Visual C++

    public Buddy GetBuddyById(
    	int id
    )

    Public Function GetBuddyById ( _
    	id As Integer _
    ) As Buddy

    public:
    Buddy^ GetBuddyById(
    	int id
    )

Parameters

id (Int32)
  the user id of the buddy.

Return Value
The buddy object.
Remarks

Since:
SmartFoxServer Pro v1.6.0

Version:
SmartFoxServer Pro

Examples
The following example shows how to retrieve a buddy from the buddy list.
CopyC#

    Buddy buddy = smartFox.GetBuddyById(25);

    Debug.WriteLine("Buddy id: " + buddy.GetId());
    Debug.WriteLine("Buddy name: " + buddy.GetName());
    Debug.WriteLine("Is buddy online? " + buddy.IsOnline());
    Debug.WriteLine("Is buddy blocked? " + buddy.IsBlocked());

    Debug.WriteLine("Buddy Variables:");
    foreach (string v in buddy.GetVariables().Keys)
        Debug.WriteLine("\t" + v + " -- " + buddy.GetVariable(v));

See Also
buddyList
GetBuddyByName(String)

Assembly: SmartFoxClientAPI_Silverlight (Module: SmartFoxClientAPI_Silverlight) Version: 1.0.0.0 (1.0.0.0)