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

* BREAKING CHANGE * this is a major shift in the way events are internally handled.
* TODO: need to complete the EventArgs class documentation
* Adds new TestClient commands "play" to play animations, and bots to detect other bots.

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3163 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
Jim Radford
2009-10-22 04:29:25 +00:00
parent b0cb77e1e5
commit 0f8677cee9
12 changed files with 1187 additions and 462 deletions

View File

@@ -30,6 +30,7 @@ namespace groupmanager
{
this.tabs = new System.Windows.Forms.TabControl();
this.tabGeneral = new System.Windows.Forms.TabPage();
this.labelInsigniaProgress = new System.Windows.Forms.Label();
this.grpPreferences = new System.Windows.Forms.GroupBox();
this.chkMature = new System.Windows.Forms.CheckBox();
this.numFee = new System.Windows.Forms.NumericUpDown();
@@ -93,7 +94,6 @@ namespace groupmanager
this.cmdCancel = new System.Windows.Forms.Button();
this.cmdOK = new System.Windows.Forms.Button();
this.cmdRefresh = new System.Windows.Forms.Button();
this.labelInsigniaProgress = new System.Windows.Forms.Label();
this.tabs.SuspendLayout();
this.tabGeneral.SuspendLayout();
this.grpPreferences.SuspendLayout();
@@ -140,6 +140,15 @@ namespace groupmanager
this.tabGeneral.Text = "General";
this.tabGeneral.UseVisualStyleBackColor = true;
//
// labelInsigniaProgress
//
this.labelInsigniaProgress.AutoSize = true;
this.labelInsigniaProgress.Location = new System.Drawing.Point(23, 149);
this.labelInsigniaProgress.Name = "labelInsigniaProgress";
this.labelInsigniaProgress.Size = new System.Drawing.Size(54, 13);
this.labelInsigniaProgress.TabIndex = 7;
this.labelInsigniaProgress.Text = "Loading...";
//
// grpPreferences
//
this.grpPreferences.Controls.Add(this.chkMature);
@@ -716,16 +725,7 @@ namespace groupmanager
this.cmdRefresh.Size = new System.Drawing.Size(121, 23);
this.cmdRefresh.TabIndex = 13;
this.cmdRefresh.Text = "Refresh from server";
this.cmdRefresh.UseVisualStyleBackColor = true;
//
// labelInsigniaProgress
//
this.labelInsigniaProgress.AutoSize = true;
this.labelInsigniaProgress.Location = new System.Drawing.Point(23, 149);
this.labelInsigniaProgress.Name = "labelInsigniaProgress";
this.labelInsigniaProgress.Size = new System.Drawing.Size(54, 13);
this.labelInsigniaProgress.TabIndex = 7;
this.labelInsigniaProgress.Text = "Loading...";
this.cmdRefresh.UseVisualStyleBackColor = true;
//
// frmGroupInfo
//

View File

@@ -24,7 +24,7 @@ namespace groupmanager
EventHandler<GroupProfileEventArgs> GroupProfileCallback;
EventHandler<GroupMembersReplyEventArgs> GroupMembersCallback;
EventHandler<GroupTitlesReplyEventArgs> GroupTitlesCallback;
AvatarManager.AvatarNamesCallback AvatarNamesCallback;
EventHandler<UUIDNameReplyEventArgs> AvatarNamesCallback;
public frmGroupInfo(Group group, GridClient client)
{
@@ -40,7 +40,7 @@ namespace groupmanager
GroupMembersCallback = new EventHandler<GroupMembersReplyEventArgs>(GroupMembersHandler);
GroupProfileCallback = new EventHandler<GroupProfileEventArgs>(GroupProfileHandler);
GroupTitlesCallback = new EventHandler<GroupTitlesReplyEventArgs>(GroupTitlesHandler);
AvatarNamesCallback = new AvatarManager.AvatarNamesCallback(AvatarNamesHandler);
AvatarNamesCallback = new EventHandler<UUIDNameReplyEventArgs>(AvatarNamesHandler);
Group = group;
Client = client;
@@ -49,7 +49,7 @@ namespace groupmanager
Client.Groups.GroupProfile += GroupProfileCallback;
Client.Groups.GroupMembersReply += GroupMembersCallback;
Client.Groups.GroupTitlesReply += GroupTitlesCallback;
Client.Avatars.OnAvatarNames += AvatarNamesCallback;
Client.Avatars.UUIDNameReply += AvatarNamesCallback;
// Request the group information
Client.Groups.RequestGroupProfile(Group.ID);
@@ -63,7 +63,7 @@ namespace groupmanager
Client.Groups.GroupProfile -= GroupProfileCallback;
Client.Groups.GroupMembersReply -= GroupMembersCallback;
Client.Groups.GroupTitlesReply -= GroupTitlesCallback;
Client.Avatars.OnAvatarNames -= AvatarNamesCallback;
Client.Avatars.UUIDNameReply -= AvatarNamesCallback;
}
private void GroupProfileHandler(object sender, GroupProfileEventArgs e)
@@ -120,11 +120,11 @@ namespace groupmanager
Client.Avatars.RequestAvatarName(Profile.FounderID);
}
private void AvatarNamesHandler(Dictionary<UUID, string> names)
private void AvatarNamesHandler(object sender, UUIDNameReplyEventArgs e)
{
lock (Names)
{
foreach (KeyValuePair<UUID, string> agent in names)
foreach (KeyValuePair<UUID, string> agent in e.Names)
{
Names[agent.Key] = agent.Value;
}