本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例6: CacheFixture
public CacheFixture()
{
IdGenerator = new IdGenerator();
ObjectGraph = new ObjectGraph();
MaterializationHooks = Enumerable.Empty<IMaterializationHook>();
Cache = new Cache(IdGenerator, ObjectGraph, MaterializationHooks);
}
示例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);
}
示例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();
}
示例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();
}
示例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>>();
}
示例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();
}
示例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
}
示例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;
}
示例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));
}
}
示例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);
}
}