public void Add(BarFactoryItem item) { if (item.factory != null) { throw new InvalidOperationException("BarFactoryItem is already added to another BarFactory instance."); } item.factory = this; int id = item.instrument.id; List<BarFactoryItem> list = this.itemLists[id]; if (list == null) { list = new List<BarFactoryItem>(); this.itemLists[id] = list; } list.Add(item); }
public void Add(BarFactoryItem item) { if (item.factory != null) { throw new InvalidOperationException("BarFactoryItem is already added to another BarFactory instance."); } item.factory = this; int id = item.instrument.id; List <BarFactoryItem> list = this.itemLists[id]; if (list == null) { list = new List <BarFactoryItem>(); this.itemLists[id] = list; } list.Add(item); }
internal void AddReminder(BarFactoryItem item, DateTime datetime) { bool flag = false; SortedList<long, List<BarFactoryItem>> sortedList; if (!this.reminderTable.TryGetValue(datetime, out sortedList)) { sortedList = new SortedList<long, List<BarFactoryItem>>(); this.reminderTable.Add(datetime, sortedList); flag = true; } List<BarFactoryItem> list; if (!sortedList.TryGetValue(item.barSize, out list)) { list = new List<BarFactoryItem>(); sortedList.Add(item.barSize, list); } list.Add(item); if (flag) { this.framework.clock.AddReminder(new ReminderCallback(this.OnReminder), datetime, null); } }
internal void AddReminder(BarFactoryItem item, DateTime datetime) { bool flag = false; SortedList <long, List <BarFactoryItem> > sortedList; if (!this.reminderTable.TryGetValue(datetime, out sortedList)) { sortedList = new SortedList <long, List <BarFactoryItem> >(); this.reminderTable.Add(datetime, sortedList); flag = true; } List <BarFactoryItem> list; if (!sortedList.TryGetValue(item.barSize, out list)) { list = new List <BarFactoryItem>(); sortedList.Add(item.barSize, list); } list.Add(item); if (flag) { this.framework.clock.AddReminder(new ReminderCallback(this.OnReminder), datetime, null); } }