Esempio n. 1
0
        internal void OnAccountData(AccountData data)
        {
            AccountDataTable table = this.GetTable(data.ProviderId, data.Route, true);

            lock (table)
            {
                AccountDataTableItem accountDataTableItem;
                if (!table.Items.TryGetValue(data.Account, out accountDataTableItem))
                {
                    accountDataTableItem = new AccountDataTableItem();
                    table.Items.Add(data.Account, accountDataTableItem);
                }
                switch (data.Type)
                {
                case AccountDataType.AccountValue:
                    this.MergeFields(data.Fields, accountDataTableItem.Values);
                    break;

                case AccountDataType.Position:
                {
                    AccountDataKey key = new AccountDataKey(data, new string[]
                        {
                            "Symbol",
                            "Maturity",
                            "PutOrCall",
                            "Strike"
                        });
                    AccountDataFieldList accountDataFieldList;
                    if (!accountDataTableItem.Positions.TryGetValue(key, out accountDataFieldList))
                    {
                        accountDataFieldList = new AccountDataFieldList();
                        accountDataTableItem.Positions.Add(key, accountDataFieldList);
                    }
                    accountDataFieldList.Clear();
                    this.CopyFields(data.Fields, accountDataFieldList);
                    break;
                }

                case AccountDataType.Order:
                {
                    AccountDataKey key2 = new AccountDataKey(data, new string[]
                        {
                            "OrderID"
                        });
                    AccountDataFieldList accountDataFieldList2;
                    if (!accountDataTableItem.Orders.TryGetValue(key2, out accountDataFieldList2))
                    {
                        accountDataFieldList2 = new AccountDataFieldList();
                        accountDataTableItem.Orders.Add(key2, accountDataFieldList2);
                    }
                    accountDataFieldList2.Clear();
                    this.CopyFields(data.Fields, accountDataFieldList2);
                    break;
                }
                }
            }
        }
Esempio n. 2
0
		internal void OnAccountData(AccountData data)
		{
			AccountDataTable table = this.GetTable(data.ProviderId, data.Route, true);
			lock (table)
			{
				AccountDataTableItem accountDataTableItem;
				if (!table.Items.TryGetValue(data.Account, out accountDataTableItem))
				{
					accountDataTableItem = new AccountDataTableItem();
					table.Items.Add(data.Account, accountDataTableItem);
				}
				switch (data.Type)
				{
				case AccountDataType.AccountValue:
					this.MergeFields(data.Fields, accountDataTableItem.Values);
					break;
				case AccountDataType.Position:
				{
					AccountDataKey key = new AccountDataKey(data, new string[]
					{
						"Symbol",
						"Maturity",
						"PutOrCall",
						"Strike"
					});
					AccountDataFieldList accountDataFieldList;
					if (!accountDataTableItem.Positions.TryGetValue(key, out accountDataFieldList))
					{
						accountDataFieldList = new AccountDataFieldList();
						accountDataTableItem.Positions.Add(key, accountDataFieldList);
					}
					accountDataFieldList.Clear();
					this.CopyFields(data.Fields, accountDataFieldList);
					break;
				}
				case AccountDataType.Order:
				{
					AccountDataKey key2 = new AccountDataKey(data, new string[]
					{
						"OrderID"
					});
					AccountDataFieldList accountDataFieldList2;
					if (!accountDataTableItem.Orders.TryGetValue(key2, out accountDataFieldList2))
					{
						accountDataFieldList2 = new AccountDataFieldList();
						accountDataTableItem.Orders.Add(key2, accountDataFieldList2);
					}
					accountDataFieldList2.Clear();
					this.CopyFields(data.Fields, accountDataFieldList2);
					break;
				}
				}
			}
		}