本文整理汇总了C#中ISecurityProvider.LookupAll方法的典型用法代码示例。如果您正苦于以下问题:C# ISecurityProvider.LookupAll方法的具体用法?C# ISecurityProvider.LookupAll怎么用?C# ISecurityProvider.LookupAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISecurityProvider
的用法示例。
在下文中一共展示了ISecurityProvider.LookupAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateProvider
private void UpdateProvider(ISecurityProvider provider)
{
if (_securityProvider == provider)
return;
if (_securityProvider != null)
{
_securityProvider.Added -= AddSecurities;
_securityProvider.Removed -= RemoveSecurities;
_securityProvider.Cleared -= ClearSecurities;
SecurityTextBox.ItemsSource = Enumerable.Empty<Security>();
_itemsSource = null;
}
_securityProvider = provider;
if (_securityProvider == null)
return;
var itemsSource = new ObservableCollectionEx<Security>();
_itemsSource = new ThreadSafeObservableCollection<Security>(itemsSource);
_itemsSource.AddRange(_securityProvider.LookupAll());
_securityProvider.Added += AddSecurities;
_securityProvider.Removed += RemoveSecurities;
_securityProvider.Cleared += ClearSecurities;
SecurityTextBox.ItemsSource = itemsSource;
}
示例2: FilterableSecurityProvider
/// <summary>
/// Initializes a new instance of the <see cref="FilterableSecurityProvider"/>.
/// </summary>
/// <param name="provider">Security meta info provider.</param>
/// <param name="ownProvider"><see langword="true"/> to leave the <paramref name="provider"/> open after the <see cref="FilterableSecurityProvider"/> object is disposed; otherwise, <see langword="false"/>.</param>
///// <param name="excludeFilter">Filter for instruments exclusion.</param>
public FilterableSecurityProvider(ISecurityProvider provider, bool ownProvider = false/*, Func<Security, bool> excludeFilter = null*/)
{
if (provider == null)
throw new ArgumentNullException(nameof(provider));
_provider = provider;
_ownProvider = ownProvider;
//ExcludeFilter = excludeFilter;
_provider.Added += AddSecurities;
_provider.Removed += RemoveSecurities;
_provider.Cleared += ClearSecurities;
AddSecurities(_provider.LookupAll());
}
示例3: HistoryMessageAdapter
/// <summary>
/// Initializes a new instance of the <see cref="HistoryMessageAdapter"/>.
/// </summary>
/// <param name="transactionIdGenerator">Transaction id generator.</param>
/// <param name="securityProvider">The provider of information about instruments.</param>
public HistoryMessageAdapter(IdGenerator transactionIdGenerator, ISecurityProvider securityProvider)
: this(transactionIdGenerator)
{
SecurityProvider = securityProvider;
BasketStorage.Boards = SecurityProvider
.LookupAll()
.Select(s => s.Board)
.Distinct();
this.AddMarketDataSupport();
this.AddSupportedMessage(ExtendedMessageTypes.EmulationState);
this.AddSupportedMessage(ExtendedMessageTypes.HistorySource);
}