• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ISecurityProvider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ISecurityProvider的典型用法代码示例。如果您正苦于以下问题:C# ISecurityProvider类的具体用法?C# ISecurityProvider怎么用?C# ISecurityProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ISecurityProvider类属于命名空间,在下文中一共展示了ISecurityProvider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: GetUnderlyingAsset

		/// <summary>
		/// To get the underlying asset by the derivative.
		/// </summary>
		/// <param name="derivative">The derivative.</param>
		/// <param name="provider">The provider of information about instruments.</param>
		/// <returns>Underlying asset.</returns>
		public static Security GetUnderlyingAsset(this Security derivative, ISecurityProvider provider)
		{
			if (derivative == null)
				throw new ArgumentNullException("derivative");

			if (provider == null)
				throw new ArgumentNullException("provider");

			if (derivative.Type == SecurityTypes.Option)
			{
				derivative.CheckOption();

				return _underlyingSecurities.SafeAdd(derivative, key =>
				{
					var underlyingSecurity = provider.LookupById(key.UnderlyingSecurityId);

					if (underlyingSecurity == null)
						throw new InvalidOperationException(LocalizedStrings.Str704Params.Put(key.UnderlyingSecurityId));

					return underlyingSecurity;
				});
			}
			else
			{
				return provider.LookupById(derivative.UnderlyingSecurityId);
			}
		}
开发者ID:kknet,项目名称:StockSharp,代码行数:33,代码来源:DerivativesHelper.cs


示例3: AccountManager

        public AccountManager(
            ISecurityProvider securityProvider,
            IAccountRepository accountRepository,
            IAccountValidator accountValidator,
            ITimeSource timeSource,
            int accountSessionCollectionCapacity,
            ISessionRepository sessionRepository,
            IActionRightResolver actionRightResolver/*,
            Func<TBizAccountRegistrationData, TBizAccount> accountRegistrationDataToAccount*/)
        {
            // todo1[ak] check args
            _securityProvider = securityProvider;
            _accountRepository = accountRepository;
            _accountValidator = accountValidator;
            _timeSource = timeSource;

            _sessionManager = new SessionManager(
                _securityProvider,
                _timeSource,
                accountSessionCollectionCapacity,
                sessionRepository);

            _actionRightResolver = actionRightResolver;
            //_accountRegistrationDataToAccount = accountRegistrationDataToAccount;
        }
开发者ID:taucode,项目名称:taucode,代码行数:25,代码来源:AccountManager.cs


示例4: SecurityIdentity

        /// <summary>
        /// Initializes a new instance of the <see cref="SecurityIdentity"/> class.
        /// </summary>
        /// <param name="provider">An <see cref="ISecurityProvider"/> of the user.</param>
        /// <exception cref="ArgumentNullException">Value specified for <paramref name="provider"/> is null.</exception>
        public SecurityIdentity(ISecurityProvider provider)
        {
            if ((object)provider == null)
                throw new ArgumentNullException(nameof(provider));

            m_provider = provider;
        }
开发者ID:GridProtectionAlliance,项目名称:gsf,代码行数:12,代码来源:SecurityIdentity.cs


示例5: CreateInstance

        public static ISecurityProvider CreateInstance()
        {
            if (_instance == null)
                _instance = new MiniSecurity();

            return _instance;
        }
开发者ID:yslib,项目名称:minimvc,代码行数:7,代码来源:MiniSecurity.cs


示例6: CreateBrokerage

        /// <summary>
        ///     Creates the brokerage under test and connects it
        /// </summary>
        /// <returns>A connected brokerage instance</returns>
        protected override IBrokerage CreateBrokerage(IOrderProvider orderProvider, ISecurityProvider securityProvider)
        {
            var environment = Config.Get("oanda-environment").ConvertTo<Environment>();
            var accessToken = Config.Get("oanda-access-token");
            var accountId = Config.Get("oanda-account-id");

            return new OandaBrokerage(orderProvider, securityProvider, environment, accessToken, accountId);
        }
开发者ID:AlexCatarino,项目名称:Lean,代码行数:12,代码来源:OandaBrokerageTests.cs


示例7: BlackScholes

		/// <summary>
		/// Initializes a new instance of the <see cref="BlackScholes"/>.
		/// </summary>
		/// <param name="option">Options contract.</param>
		/// <param name="securityProvider">The provider of information about instruments.</param>
		/// <param name="dataProvider">The market data provider.</param>
		public BlackScholes(Security option, ISecurityProvider securityProvider, IMarketDataProvider dataProvider)
			: this(securityProvider, dataProvider)
		{
			if (option == null)
				throw new ArgumentNullException(nameof(option));

			Option = option;
		}
开发者ID:vikewoods,项目名称:StockSharp,代码行数:14,代码来源:BlackScholes.cs


示例8: MembershipProviderManagementService

        public MembershipProviderManagementService(IPersonRepository personRepository,
                                                   ISecurityProvider securityProvider)
        {
            Check.Require(personRepository != null, "userRepository may not be null");

            _personRepository = personRepository;
            _securityProvider = securityProvider;
        }
开发者ID:ryantornberg,项目名称:wrms,代码行数:8,代码来源:MembershipProviderService.cs


示例9: SetSecurityProvider

 public void SetSecurityProvider(ISecurityProvider provider)
 {
     if (_securityProvider != null) return;
     lock (_locker)
     {
         if (_securityProvider != null) return;
         _securityProvider = provider;
     }
 }
开发者ID:Markeli,项目名称:BeardlyTeam,代码行数:9,代码来源:SecurityController.cs


示例10: UserController

 public UserController(
     ISecurityProvider securityProvider,
     ICommercialRepository repositoryCommerce,
     IMailProvider mailProvider)
 {
     _securityProvider = securityProvider;
     _repositoryCommerce = repositoryCommerce;
     _mailProvider = mailProvider;
 }
开发者ID:igorquintaes,项目名称:TibiaCommunity,代码行数:9,代码来源:UserController.cs


示例11: CreateBrokerage

        /// <summary>
        /// Creates the brokerage under test
        /// </summary>
        /// <returns>A connected brokerage instance</returns>
        protected override IBrokerage CreateBrokerage(IOrderProvider orderProvider, ISecurityProvider securityProvider)
        {
            var server = Config.Get("fxcm-server");
            var terminal = Config.Get("fxcm-terminal");
            var userName = Config.Get("fxcm-user-name");
            var password = Config.Get("fxcm-password");
            var accountId = Config.Get("fxcm-account-id");

            return new FxcmBrokerage(orderProvider, securityProvider, server, terminal, userName, password, accountId);
        }
开发者ID:skyfyl,项目名称:Lean,代码行数:14,代码来源:FxcmBrokerageTests.cs


示例12: Synthetic

		/// <summary>
		/// Initializes a new instance of the <see cref="Synthetic"/>.
		/// </summary>
		/// <param name="security">The instrument (the option or the underlying asset).</param>
		/// <param name="provider">The provider of information about instruments.</param>
		public Synthetic(Security security, ISecurityProvider provider)
		{
			if (security == null)
				throw new ArgumentNullException(nameof(security));

			if (provider == null)
				throw new ArgumentNullException(nameof(provider));

			_security = security;
			_provider = provider;
		}
开发者ID:vikewoods,项目名称:StockSharp,代码行数:16,代码来源:Synthetic.cs


示例13: FxcmBrokerage

 /// <summary>
 /// Creates a new instance of the <see cref="FxcmBrokerage"/> class
 /// </summary>
 /// <param name="orderProvider">The order provider</param>
 /// <param name="securityProvider">The holdings provider</param>
 /// <param name="server">The url of the server</param>
 /// <param name="terminal">The terminal name</param>
 /// <param name="userName">The user name (login id)</param>
 /// <param name="password">The user password</param>
 /// <param name="accountId">The account id</param>
 public FxcmBrokerage(IOrderProvider orderProvider, ISecurityProvider securityProvider, string server, string terminal, string userName, string password, string accountId)
     : base("FXCM Brokerage")
 {
     _orderProvider = orderProvider;
     _securityProvider = securityProvider;
     _server = server;
     _terminal = terminal;
     _userName = userName;
     _password = password;
     _accountId = accountId;
 }
开发者ID:skyfyl,项目名称:Lean,代码行数:21,代码来源:FxcmBrokerage.cs


示例14: OandaBrokerage

        /// <summary>
        /// Initializes a new instance of the <see cref="OandaBrokerage"/> class.
        /// </summary>
        /// <param name="orderProvider">The order provider.</param>
        /// <param name="securityProvider">The holdings provider.</param>
        /// <param name="environment">The Oanda environment (Trade or Practice)</param>
        /// <param name="accessToken">The Oanda access token (can be the user's personal access token or the access token obtained with OAuth by QC on behalf of the user)</param>
        /// <param name="accountId">The account identifier.</param>
        public OandaBrokerage(IOrderProvider orderProvider, ISecurityProvider securityProvider, Environment environment, string accessToken, int accountId)
            : base("Oanda Brokerage")
        {
            _orderProvider = orderProvider;
            _securityProvider = securityProvider;

            if (environment != Environment.Trade && environment != Environment.Practice)
                throw new NotSupportedException("Oanda Environment not supported: " + environment);

            _environment = environment;
            _accessToken = accessToken;
            _accountId = accountId;
        }
开发者ID:skyfyl,项目名称:Lean,代码行数:21,代码来源:OandaBrokerage.cs


示例15: FxcmBrokerage

        /// <summary>
        /// Creates a new instance of the <see cref="FxcmBrokerage"/> class
        /// </summary>
        /// <param name="orderProvider">The order provider</param>
        /// <param name="securityProvider">The holdings provider</param>
        /// <param name="server">The url of the server</param>
        /// <param name="terminal">The terminal name</param>
        /// <param name="userName">The user name (login id)</param>
        /// <param name="password">The user password</param>
        /// <param name="accountId">The account id</param>
        public FxcmBrokerage(IOrderProvider orderProvider, ISecurityProvider securityProvider, string server, string terminal, string userName, string password, string accountId)
            : base("FXCM Brokerage")
        {
            _orderProvider = orderProvider;
            _securityProvider = securityProvider;
            _server = server;
            _terminal = terminal;
            _userName = userName;
            _password = password;
            _accountId = accountId;

            HistoryResponseTimeout = 5000;
            MaximumHistoryRetryAttempts = 1;
        }
开发者ID:AlexCatarino,项目名称:Lean,代码行数:24,代码来源:FxcmBrokerage.cs


示例16: CreateBrokerage

 protected override IBrokerage CreateBrokerage(IOrderProvider orderProvider, ISecurityProvider securityProvider)
 {
     if (!_manualGatewayControl && !_gatewayLaunched)
     {
         _gatewayLaunched = true;
         InteractiveBrokersGatewayRunner.Start(Config.Get("ib-controller-dir"),
             Config.Get("ib-tws-dir"),
             Config.Get("ib-user-name"),
             Config.Get("ib-password"),
             Config.GetBool("ib-use-tws")
             );
     }
     return new InteractiveBrokersBrokerage(orderProvider, securityProvider);
 }
开发者ID:skyfyl,项目名称:Lean,代码行数:14,代码来源:InteractiveBrokersOrderTests.cs


示例17: SessionManager

        internal SessionManager(ISecurityProvider securityProvider, ITimeSource timeSource, int accountSessionCollectionCapacity, ISessionRepository sessionRepository)
        {
            // todo1[ak] check args

            _securityProvider = securityProvider;
            _timeSource = timeSource;

            _accountSessionCollectionCapacity = accountSessionCollectionCapacity;
            _accountSessions = new Dictionary<string, IAccountSessionCollection>();

            _lock = new object();
            _allSessions = new Dictionary<string, BizSession>();

            _sessionRepository = sessionRepository;
        }
开发者ID:taucode,项目名称:taucode,代码行数:15,代码来源:SessionManager.cs


示例18: FakeAccountRepository

        public FakeAccountRepository(IEnumerable<BizAccountRegistrationData> initialRegDatas, ISecurityProvider securityProvider)
        {
            _accounts = new Dictionary<long, AccountRec>();

            if (initialRegDatas != null)
            {
                foreach (var rd in initialRegDatas)
                {
                    BizAccount acc = WagenBackendHelper.AccountRegistrationDataToAccount(rd);
                    string hash = securityProvider.GetPasswordHashString(rd.Password);

                    this.AddAccount(acc, hash);
                }
            }
        }
开发者ID:taucode,项目名称:taucode,代码行数:15,代码来源:FakeAccountRepository.cs


示例19: BasketStrike

		/// <summary>
		/// Инициализировать <see cref="BasketStrike"/>.
		/// </summary>
		/// <param name="underlyingAsset">Базовый актив.</param>
		/// <param name="securityProvider">Поставщик информации об инструментах.</param>
		/// <param name="dataProvider">Поставщик маркет-данных.</param>
		protected BasketStrike(Security underlyingAsset, ISecurityProvider securityProvider, IMarketDataProvider dataProvider)
		{
			if (underlyingAsset == null)
				throw new ArgumentNullException("underlyingAsset");

			if (securityProvider == null)
				throw new ArgumentNullException("securityProvider");

			if (dataProvider == null)
				throw new ArgumentNullException("dataProvider");

			UnderlyingAsset = underlyingAsset;
			SecurityProvider = securityProvider;
			DataProvider = dataProvider;
		}
开发者ID:reddream,项目名称:StockSharp,代码行数:21,代码来源:BasketStrike.cs


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ISecurityService类代码示例发布时间:2022-05-24
下一篇:
C# ISecurityObjectId类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap