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

* Many other code cleanups and example updates
* BREAKING - this is a major shift in the way events are internally handled.

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3145 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
Jim Radford
2009-10-16 02:53:53 +00:00
parent 0567a983fc
commit ba491c6a63
16 changed files with 1591 additions and 627 deletions

View File

@@ -17,17 +17,17 @@ namespace OpenMetaverse.TestClient
public override string Execute(string[] args, UUID fromAgentID)
{
System.Threading.AutoResetEvent waitBalance = new System.Threading.AutoResetEvent(false);
AgentManager.BalanceCallback del = delegate(int balance) { waitBalance.Set(); };
Client.Self.OnBalanceUpdated += del;
EventHandler<BalanceEventArgs> del = delegate(object sender, BalanceEventArgs e) { waitBalance.Set(); };
Client.Self.MoneyBalance += del;
Client.Self.RequestBalance();
String result = "Timeout waiting for balance reply";
if (waitBalance.WaitOne(10000, false))
{
result = Client.ToString() + " has L$: " + Client.Self.Balance;
}
Client.Self.OnBalanceUpdated -= del;
return result;
}
Client.Self.MoneyBalance -= del;
return result;
}
}
}