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