LIBOMV-686 Implements new event patterns based on the Microsoft Framework Design Guidelines in GroupManager

* BREAKING CHANGE * this is a major shift in the way events are internally handled.

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3162 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
Jim Radford
2009-10-20 20:18:03 +00:00
parent 9f8d0d49f0
commit b0cb77e1e5
12 changed files with 869 additions and 408 deletions

View File

@@ -29,14 +29,13 @@ namespace OpenMetaverse.TestClient
groupName = groupName.Trim();
UUID groupUUID = Client.GroupName2UUID(groupName);
if (UUID.Zero != groupUUID) {
GroupManager.GroupLeftCallback lcallback = new GroupManager.GroupLeftCallback(Groups_OnGroupLeft);
Client.Groups.OnGroupLeft += lcallback;
if (UUID.Zero != groupUUID) {
Client.Groups.GroupLeaveReply += Groups_GroupLeft;
Client.Groups.LeaveGroup(groupUUID);
GroupsEvent.WaitOne(30000, false);
Client.Groups.GroupLeaveReply -= Groups_GroupLeft;
Client.Groups.OnGroupLeft -= lcallback;
GroupsEvent.Reset();
Client.ReloadGroupsCache();
@@ -47,13 +46,13 @@ namespace OpenMetaverse.TestClient
return Client.ToString() + " doesn't seem to be member of the group " + groupName;
}
void Groups_OnGroupLeft(UUID groupID, bool success)
void Groups_GroupLeft(object sender, GroupOperationEventArgs e)
{
Console.WriteLine(Client.ToString() + (success ? " has left group " : " failed to left group ") + groupID.ToString());
Console.WriteLine(Client.ToString() + (e.Success ? " has left group " : " failed to left group ") + e.GroupID.ToString());
leftGroup = success;
leftGroup = e.Success;
GroupsEvent.Set();
}
}
}