internal bool AddReminder(BarFactoryItem item, DateTime dateTime, ClockType type)
{
bool created = false;
SortedList<long, List<BarFactoryItem>> slistByBarSize;
if (!this.reminderTable.TryGetValue(dateTime, out slistByBarSize))
{
slistByBarSize = new SortedList<long, List<BarFactoryItem>>();
this.reminderTable.Add(dateTime, slistByBarSize);
created = true;
}
List<BarFactoryItem> list;
if (!slistByBarSize.TryGetValue(item.barSize, out list))
{
list = new List<BarFactoryItem>();
slistByBarSize.Add(item.barSize, list);
}
list.Add(item);
if (created)
{
var clock = type == ClockType.Exchange ? this.framework.ExchangeClock : this.framework.Clock;
return clock.AddReminder(OnReminder, dateTime);
}
return true;
}