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

* Completes Full documentation of DirectoryManager class
* Cleaned up Search Methods in DirectoryManager to be more developer friendly
* Adds Several TestClient commands related to DirectoryManager: searchgroups, searchland, searchpeople
* Adds a StructToString method to helpers to simplify parsing and printing Structs for debugging purposes
* Many other code cleanups
* BREAKING - this is a major shift in the way events are internally handled, Take a look at the newly added TestClient commands for example code that implement this pattern.

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3139 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
Jim Radford
2009-10-10 06:38:07 +00:00
parent 870ce77bfe
commit d34730a019
14 changed files with 1065 additions and 422 deletions

View File

@@ -31,21 +31,21 @@ namespace OpenMetaverse.TestClient
if (masterName.Length == 0)
return "Usage: setmaster [name]";
DirectoryManager.DirPeopleReplyCallback callback = new DirectoryManager.DirPeopleReplyCallback(KeyResolvHandler);
Client.Directory.OnDirPeopleReply += callback;
EventHandler<DirPeopleReplyEventArgs> callback = KeyResolvHandler;
Client.Directory.DirPeopleReply += callback;
query = Client.Directory.StartPeopleSearch(DirectoryManager.DirFindFlags.People, masterName, 0);
query = Client.Directory.StartPeopleSearch(masterName, 0);
if (keyResolution.WaitOne(TimeSpan.FromMinutes(1), false))
{
Client.MasterKey = resolvedMasterKey;
keyResolution.Reset();
Client.Directory.OnDirPeopleReply -= callback;
Client.Directory.DirPeopleReply -= callback;
}
else
{
keyResolution.Reset();
Client.Directory.OnDirPeopleReply -= callback;
Client.Directory.DirPeopleReply -= callback;
return "Unable to obtain UUID for \"" + masterName + "\". Master unchanged.";
}
@@ -56,12 +56,12 @@ namespace OpenMetaverse.TestClient
return String.Format("Master set to {0} ({1})", masterName, Client.MasterKey.ToString());
}
private void KeyResolvHandler(UUID queryid, List<DirectoryManager.AgentSearchData> matches)
private void KeyResolvHandler(object sender, DirPeopleReplyEventArgs e)
{
if (query != queryid)
if (query != e.QueryID)
return;
resolvedMasterKey = matches[0].AgentID;
resolvedMasterKey = e.MatchedPeople[0].AgentID;
keyResolution.Set();
query = UUID.Zero;
}