Status

View as Markdown

Definition

Indicates the current status of the primary data connection.

Properties

\<connection\>.Status

Examples

1private int priceLost;
2private int mainLost;
3
4private void OnAccountItemUpdate(object sender, AccountItemEventArgs e)
5{
6// Count the number of times OnAccountItemUpdate() is called with a lost price connection
7if (myAccount.Connection.PriceStatus == ConnectionStatus.ConnectionLost)
8
9
10priceLost += 1;
11
12// Count the number of times OnAccountItemUpdate() is called with a lost primary connection
13
14if (myAccount.Connection.Status == ConnectionStatus.ConnectionLost)
15mainLost += 1;
16
17// Print the number of times each connection was lost during OnAccountItemUpdate()
18if (mainLost > 0 || priceLost > 0)
19Print(String.Format("Main connection lost {0} times. Price feed lost {1} times.", mainLost, priceLost));
20
21
22Print(String.Format("Main connection lost {0} times. Price feed lost {1} times.",
23mainLost, priceLost));
24}