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:
@@ -28,12 +28,12 @@ namespace OpenMetaverse.TestClient.Commands
|
||||
waitQuery.Reset();
|
||||
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
||||
DirectoryManager.DirPlacesReplyCallback callback = delegate(UUID queryID, List<DirectoryManager.DirectoryParcel> matchedParcels)
|
||||
|
||||
EventHandler<PlacesReplyEventArgs> callback = delegate(object sender, PlacesReplyEventArgs e)
|
||||
{
|
||||
result.AppendFormat("Your search string '{0}' returned {1} results" + System.Environment.NewLine,
|
||||
searchText, matchedParcels.Count);
|
||||
foreach (DirectoryManager.DirectoryParcel place in matchedParcels)
|
||||
searchText, e.MatchedPlaces.Count);
|
||||
foreach (DirectoryManager.PlacesSearchData place in e.MatchedPlaces)
|
||||
{
|
||||
result.AppendLine(place.ToString());
|
||||
}
|
||||
@@ -41,18 +41,17 @@ namespace OpenMetaverse.TestClient.Commands
|
||||
waitQuery.Set();
|
||||
};
|
||||
|
||||
Client.Directory.OnDirPlacesReply += callback;
|
||||
|
||||
UUID searchID = Client.Directory.StartClassifiedSearch(searchText, DirectoryManager.ClassifiedCategories.Any, DirectoryManager.ClassifiedQueryFlags.Mature | DirectoryManager.ClassifiedQueryFlags.PG);
|
||||
Client.Directory.PlacesReply += callback;
|
||||
Client.Directory.StartPlacesSearch(searchText);
|
||||
|
||||
if (!waitQuery.WaitOne(20000, false) && Client.Network.Connected)
|
||||
{
|
||||
result.AppendLine("Timeout waiting for simulator to respond to query.");
|
||||
}
|
||||
|
||||
Client.Directory.OnDirPlacesReply -= callback;
|
||||
Client.Directory.PlacesReply -= callback;
|
||||
|
||||
return result.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user