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:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user