diff --git a/libremetaverse-core/Libremetaverse/FriendsManager.cs b/libremetaverse-core/Libremetaverse/FriendsManager.cs index 211b582..7730469 100644 --- a/libremetaverse-core/Libremetaverse/FriendsManager.cs +++ b/libremetaverse-core/Libremetaverse/FriendsManager.cs @@ -234,6 +234,22 @@ namespace OpenMetaverse { #region Delegates + private EventHandler m_FriendsListReadyResponse; + + protected virtual void OnfriendsListReady(FriendsReadyEventArgs e) + { + EventHandler handler = m_FriendsListReadyResponse; + if (handler != null) + handler(this, e); + } + + public event EventHandler friendsListReady + { + add { lock (m_FriendOfflineLock) { m_FriendsListReadyResponse += value; } } + remove { lock (m_FriendOfflineLock) { m_FriendsListReadyResponse -= value; } } + } + + /// The event subscribers. null if no subcribers private EventHandler m_FriendOnline; @@ -918,11 +934,36 @@ namespace OpenMetaverse } } } + OnfriendsListReady(new FriendsReadyEventArgs(FriendList.Count)); } } + + + } #region EventArgs + + public class FriendsReadyEventArgs : EventArgs + { + private readonly int m_count; + + /// Number of friends we have + public int Count { get { return m_count; } } + /// Get the name of the agent we requested a friendship with + + /// + /// Construct a new instance of the FriendShipResponseEventArgs class + /// + /// The ID of the agent we requested a friendship with + /// The name of the agent we requested a friendship with + /// true if the agent accepted our friendship offer + public FriendsReadyEventArgs(int count) + { + this.m_count = count; + } + } + /// Contains information on a member of our friends list public class FriendInfoEventArgs : EventArgs {