SmartFoxServer Silverlight API
GetBuddyByName Method (buddyName)
NamespacesSmartFoxClientAPISmartFoxClientGetBuddyByName(String)
Get a buddy from the buddy list, using the buddy's username as key.
Refer to the buddyList property for a description of the buddy object's properties.
Declaration Syntax
C#Visual BasicVisual C++
public Buddy GetBuddyByName(
	string buddyName
)
Public Function GetBuddyByName ( _
	buddyName As String _
) As Buddy
public:
Buddy^ GetBuddyByName(
	String^ buddyName
)
Parameters
buddyName (String)
the username 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.GetBuddyByName("jack");

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

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