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


C# IdGenerator类代码示例

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


IdGenerator类属于命名空间,在下文中一共展示了IdGenerator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SterlingMessageAdapter

		/// <summary>
		/// Initializes a new instance of the <see cref="SterlingMessageAdapter"/>.
		/// </summary>
		/// <param name="transactionIdGenerator">Transaction id generator.</param>
		public SterlingMessageAdapter(IdGenerator transactionIdGenerator)
			: base(transactionIdGenerator)
		{
			this.AddMarketDataSupport();
			this.AddTransactionalSupport();
			this.RemoveSupportedMessage(MessageTypes.SecurityLookup);
		}
开发者ID:RakotVT,项目名称:StockSharp,代码行数:11,代码来源:SterlingMessageAdapter.cs

示例2: RithmicMessageAdapter

		/// <summary>
		/// Initializes a new instance of the <see cref="RithmicMessageAdapter"/>.
		/// </summary>
		/// <param name="transactionIdGenerator">Transaction id generator.</param>
		public RithmicMessageAdapter(IdGenerator transactionIdGenerator)
			: base(transactionIdGenerator)
		{
			this.AddMarketDataSupport();
			this.AddTransactionalSupport();
			this.AddSupportedMessage(MessageTypes.ChangePassword);
		}
开发者ID:RakotVT,项目名称:StockSharp,代码行数:11,代码来源:RithmicMessageAdapter.cs

示例3: RssMarketDataMessageAdapter

		/// <summary>
		/// Создать <see cref="RssMarketDataMessageAdapter"/>.
		/// </summary>
		/// <param name="transactionIdGenerator">Генератор идентификаторов транзакций.</param>
		public RssMarketDataMessageAdapter(IdGenerator transactionIdGenerator)
			: base(transactionIdGenerator)
		{
			HeartbeatInterval = TimeSpan.FromMinutes(5);
			
			this.AddSupportedMessage(MessageTypes.MarketData);
		}
开发者ID:reddream,项目名称:StockSharp,代码行数:11,代码来源:RssMarketDataMessageAdapter.cs

示例4: SmartComMessageAdapter

		/// <summary>
		/// Создать <see cref="SmartComMessageAdapter"/>.
		/// </summary>
		/// <param name="transactionIdGenerator">Генератор идентификаторов транзакций.</param>
		public SmartComMessageAdapter(IdGenerator transactionIdGenerator)
			: base(transactionIdGenerator)
		{
			Version = SmartComVersions.V3;

			SecurityClassInfo.Add("OPT", RefTuple.Create(SecurityTypes.Option, ExchangeBoard.Forts.Code));
			SecurityClassInfo.Add("OPTM", RefTuple.Create(SecurityTypes.Option, ExchangeBoard.Forts.Code));
			SecurityClassInfo.Add("FUT", RefTuple.Create(SecurityTypes.Future, ExchangeBoard.Forts.Code));
			SecurityClassInfo.Add("FXMFD", RefTuple.Create(SecurityTypes.Currency, ExchangeBoard.Mfd.Code));
			SecurityClassInfo.Add("WFMFD", RefTuple.Create(SecurityTypes.Index, ExchangeBoard.Mfd.Code));
			SecurityClassInfo.Add("WIMFD", RefTuple.Create(SecurityTypes.Index, ExchangeBoard.Mfd.Code));
			SecurityClassInfo.Add("EQBR", RefTuple.Create(SecurityTypes.Stock, ExchangeBoard.MicexEqbr.Code));
			SecurityClassInfo.Add("TQBR", RefTuple.Create(SecurityTypes.Stock, ExchangeBoard.MicexTqbr.Code));
			SecurityClassInfo.Add("TQNE", RefTuple.Create(SecurityTypes.Stock, ExchangeBoard.MicexTqne.Code));
			SecurityClassInfo.Add("EQNE", RefTuple.Create(SecurityTypes.Stock, ExchangeBoard.MicexEqne.Code));
			SecurityClassInfo.Add("EQOB", RefTuple.Create(SecurityTypes.Bond, ExchangeBoard.MicexEqob.Code));
			SecurityClassInfo.Add("EQNB", RefTuple.Create(SecurityTypes.Bond, ExchangeBoard.MicexEqnb.Code));
			SecurityClassInfo.Add("EQDB", RefTuple.Create(SecurityTypes.Bond, ExchangeBoard.MicexEqdb.Code));
			SecurityClassInfo.Add("EQOS", RefTuple.Create(SecurityTypes.Bond, ExchangeBoard.MicexEqos.Code));
			SecurityClassInfo.Add("TQOB", RefTuple.Create(SecurityTypes.Bond, ExchangeBoard.MicexTqob.Code));
			SecurityClassInfo.Add("TQLV", RefTuple.Create(SecurityTypes.Stock, ExchangeBoard.MicexTqlv.Code));

			PortfolioBoardCodes = new Dictionary<string, string>
			{
			    { "EQ", ExchangeBoard.MicexEqbr.Code },
			    { "FOB", ExchangeBoard.MicexFbcb.Code },
			    { "RTS_FUT", ExchangeBoard.Forts.Code },
			};

			UpdatePlatform();

			this.AddMarketDataSupport();
			this.AddTransactionalSupport();
			this.RemoveSupportedMessage(MessageTypes.OrderStatus);
		}
开发者ID:AlexYurasov,项目名称:StockSharp,代码行数:39,代码来源:SmartComMessageAdapter.cs

示例5: GameScene

 public GameScene()
 {
     objects = new MyContainer<PivotObject>(100, 10);
     VisibleObjects = new MyContainer<PivotObject>(100, 2);
     ShadowObjects = new MyContainer<PivotObject>(100, 2);
     sceneGraph = new SceneGraph.SceneGraph(this);
     idgenertor = new IdGenerator(0);
 }
开发者ID:KatekovAnton,项目名称:ResourceCollector,代码行数:8,代码来源:GameScene.cs

示例6: CacheFixture

            public CacheFixture()
            {
                IdGenerator = new IdGenerator();
                ObjectGraph = new ObjectGraph();
                MaterializationHooks = Enumerable.Empty<IMaterializationHook>();

                Cache = new Cache(IdGenerator, ObjectGraph, MaterializationHooks);
            }
开发者ID:Tatooine,项目名称:FakeDb,代码行数:8,代码来源:CacheFacts.cs

示例7: ETradeMessageAdapter

		/// <summary>
		/// Initializes a new instance of the <see cref="ETradeMessageAdapter"/>.
		/// </summary>
		/// <param name="transactionIdGenerator">Transaction id generator.</param>
		public ETradeMessageAdapter(IdGenerator transactionIdGenerator)
			: base(transactionIdGenerator)
		{
			this.AddMarketDataSupport();
			this.AddTransactionalSupport();

			this.RemoveSupportedMessage(MessageTypes.PortfolioLookup);
		}
开发者ID:hbwjz,项目名称:StockSharp,代码行数:12,代码来源:ETradeMessageAdapter.cs

示例8: OandaMessageAdapter

		/// <summary>
		/// Создать <see cref="OandaMessageAdapter"/>.
		/// </summary>
		/// <param name="transactionIdGenerator">Генератор идентификаторов транзакций.</param>
		public OandaMessageAdapter(IdGenerator transactionIdGenerator)
			: base(transactionIdGenerator)
		{
			HeartbeatInterval = TimeSpan.FromSeconds(60);

			this.AddMarketDataSupport();
			this.AddTransactionalSupport();
		}
开发者ID:rudrp,项目名称:StockSharp,代码行数:12,代码来源:OandaMessageAdapter.cs

示例9: InteractiveBrokersMessageAdapter

		/// <summary>
		/// Initializes a new instance of the <see cref="InteractiveBrokersMessageAdapter"/>.
		/// </summary>
		/// <param name="transactionIdGenerator">Transaction id generator.</param>
		public InteractiveBrokersMessageAdapter(IdGenerator transactionIdGenerator)
			: base(transactionIdGenerator)
		{
			Address = DefaultAddress;
			ServerLogLevel = ServerLogLevels.Detail;

			this.AddMarketDataSupport();
			this.AddTransactionalSupport();
		}
开发者ID:hbwjz,项目名称:StockSharp,代码行数:13,代码来源:InteractiveBrokersMessageAdapter.cs

示例10: MessageAdapter

		/// <summary>
		/// Initialize <see cref="MessageAdapter"/>.
		/// </summary>
		/// <param name="transactionIdGenerator">Transaction id generator.</param>
		protected MessageAdapter(IdGenerator transactionIdGenerator)
		{
			if (transactionIdGenerator == null)
				throw new ArgumentNullException("transactionIdGenerator");

			Platform = Platforms.AnyCPU;

			TransactionIdGenerator = transactionIdGenerator;
			SecurityClassInfo = new Dictionary<string, RefPair<SecurityTypes, string>>();
		}
开发者ID:yadrewn,项目名称:StockSharpShared_Before2016_05_25,代码行数:14,代码来源:MessageAdapter.cs

示例11: BitStampMessageAdapter

		/// <summary>
		/// Создать <see cref="BitStampMessageAdapter"/>.
		/// </summary>
		/// <param name="transactionIdGenerator">Генератор идентификаторов транзакций.</param>
		public BitStampMessageAdapter(IdGenerator transactionIdGenerator)
			: base(transactionIdGenerator)
		{
			// https://www.bitstamp.net/api/
			// Do not make more than 600 request per 10 minutes or we will ban your IP address.
			HeartbeatInterval = TimeSpan.FromSeconds(1);

			this.AddMarketDataSupport();
			this.AddTransactionalSupport();
		}
开发者ID:osya,项目名称:StockSharp,代码行数:14,代码来源:BitStampMessageAdapter.cs

示例12: Constructor_Throws_OnTimestampWraparound

        public void Constructor_Throws_OnTimestampWraparound()
        {
            var mc = MaskConfig.Default;
            var ts = new MockTimeSource(mc.WraparoundDate(TESTEPOCH).AddMilliseconds(-1));  //Set clock to 1 ms before epoch
            var g = new IdGenerator(0, TESTEPOCH, MaskConfig.Default, ts);

            Assert.IsTrue(g.CreateId() > 0);   //Should succeed;
            ts.NextTick();
            g.CreateId();   //Should fail
        }
开发者ID:BuddyTV,项目名称:IdGen,代码行数:10,代码来源:IdGenTests.cs

示例13: LuaFixTransactionMessageAdapter

		/// <summary>
		/// Создать <see cref="LuaFixTransactionMessageAdapter"/>.
		/// </summary>
		/// <param name="transactionIdGenerator">Генератор идентификаторов транзакций.</param>
		public LuaFixTransactionMessageAdapter(IdGenerator transactionIdGenerator)
			: base(transactionIdGenerator)
		{
			this.RemoveMarketDataSupport();

			Login = "quik";
			Password = "quik".To<SecureString>();
			Address = QuikTrader.DefaultLuaAddress;
			TargetCompId = "StockSharpTS";
			SenderCompId = "quik";
			//ExchangeBoard = ExchangeBoard.Forts;
			RequestAllPortfolios = true;
		}
开发者ID:jsonbao,项目名称:StockSharp,代码行数:17,代码来源:LuaFixTransactionMessageAdapter.cs

示例14: UpdatesState

        public void UpdatesState()
        {
            toTest = new IdGenerator();
            StoreNewObject();
            toTest = new IdGenerator();
            StoreNewObject();

            toTest = new IdGenerator();
            using (var container = NewInstance())
            {
                Assert.AreEqual( 3,Increment(container));
            }
        }
开发者ID:masroore,项目名称:db4o-extras,代码行数:13,代码来源:TestAutoIncrementGenerator.cs

示例15: StoresState

        public void StoresState()
        {
            using (var container1 = NewInstance())
            {
                toTest.NextId(typeof(WithAutoIDs), container1);
                toTest.StoreState(container1);
            }

            toTest = new IdGenerator();
            using (var container2 = NewInstance())
            {
                Assert.AreEqual(Increment(container2), 2);
            }
        }
开发者ID:masroore,项目名称:db4o-extras,代码行数:14,代码来源:TestAutoIncrementGenerator.cs


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