当前位置: 首页>>代码示例>>C#>>正文


C# ISecurityProvider.LookupAll方法代码示例

本文整理汇总了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;
		}
开发者ID:qiujoe,项目名称:StockSharp,代码行数:31,代码来源:SecurityEditor.xaml.cs

示例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());
		}
开发者ID:qiujoe,项目名称:StockSharp,代码行数:22,代码来源:FilterableSecurityProvider.cs

示例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);
		}
开发者ID:RakotVT,项目名称:StockSharp,代码行数:18,代码来源:HistoryMessageAdapter.cs


注:本文中的ISecurityProvider.LookupAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。