本文整理汇总了C#中Instrument.GetValidOrderFeeds方法的典型用法代码示例。如果您正苦于以下问题:C# Instrument.GetValidOrderFeeds方法的具体用法?C# Instrument.GetValidOrderFeeds怎么用?C# Instrument.GetValidOrderFeeds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Instrument
的用法示例。
在下文中一共展示了Instrument.GetValidOrderFeeds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOrderFeedByName
/// <summary>
/// Helper function for finding an OrderFeed given a gateway name
/// </summary>
OrderFeed GetOrderFeedByName(Instrument instr, string gateway)
{
foreach (OrderFeed oFeed in instr.GetValidOrderFeeds())
{
if (oFeed.Name.Equals(gateway))
{
return oFeed;
}
}
return (OrderFeed)null;
}
示例2: populateOrderFeedDropDown
/// <summary>
/// populate the OrderFeed drop down menu.
/// </summary>
/// <remarks>
/// comboBoxOrderFeed DisplayMember is set to Name to display the OrderFeed's Name property.
/// </remarks>
/// <param name="instrument">Instrument to find valid order feeds.</param>
private void populateOrderFeedDropDown(Instrument instrument)
{
comboBoxOrderFeed.Items.Clear();
foreach (OrderFeed orderFeed in instrument.GetValidOrderFeeds())
{
comboBoxOrderFeed.Items.Add(orderFeed);
}
}
示例3: updateInstrument
/// <summary>
/// Update the instrument information in the grid.
/// </summary>
/// <param name="instrument">Instrument</param>
private void updateInstrument(Instrument instrument)
{
for (int i = 1; i < dataGridViewSpreadDetails.Columns.Count; i++)
{
//get the instrument which is a hidden row
InstrumentKey instrKey = (InstrumentKey)dataGridViewSpreadDetails.Rows[(int)FieldType.HiddenObject].Cells[i].Value;
if (instrument.Key == instrKey)
{
string instrName = instrument.GetFormattedName(InstrumentNameFormat.Full);
dataGridViewSpreadDetails.Rows[(int)FieldType.Contract].Cells[i].Value = instrName;
DataGridViewComboBoxCell combo = (DataGridViewComboBoxCell)dataGridViewSpreadDetails.Rows[(int)FieldType.OrderFeedCombo].Cells[i];
combo.DisplayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton;
string selectedOrderFeed = (string)combo.Value;
combo.Items.Clear();
combo.Value = "";
foreach (var feed in instrument.GetValidOrderFeeds())
{
combo.Items.Add(feed.ConnectionKey.GatewayKey.Name);
}
if (!String.IsNullOrEmpty(selectedOrderFeed) && combo.Items.Contains(selectedOrderFeed))
{
combo.Value = selectedOrderFeed;
}
}
}
}