AccountItemEventArgs

View as Markdown

Definition

AccountItemEventArgs contains Account-related information to be passed as an argument to the OnAccountItemUpdate event.

For a complete, working example of this class in use, download framework example located on our Developing AddOns Overview.

The properties listed below are accessible from an instance of AccountItemEventArgs:

AccountThe Account for which OnAccountItemUpdate() was called
AccountItemThe AccountItem which has updated, resulting in the call to OnAccountItemUpdate()
CurrencyThe currency of the Account in question
TimeA DateTime object representing the time at which the change occurred
ValueThe new value of the updated AccountItems

Example

1// This method is fired on any change of an AccountItem
2private void OnAccountItemUpdate(object sender, AccountItemEventArgs e)
3{
4 /* Dispatcher.InvokeAsync() is needed for multi-threading considerations. When processing events outside of the UI thread, and we want to
5 influence the UI .InvokeAsync() allows us to do so. It can also help prevent the UI thread from locking up on long operations. */
6 Dispatcher.InvokeAsync(() =>
7 {
8 //Print which AccountItem changed, on which account, and the new value, using
9 outputBox.AppendText(string.Format("{0}Account: {1}{0}AccountItem: {2}{0}Value: {3}",
10 Environment.NewLine,
11 e.Account.Name,
12 e.AccountItem,
13 e.Value));
14 });
15}