Ejemplo n.º 1
0
		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);
		}
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
		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);
			}
		}
Ejemplo n.º 4
0
        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);
            }
        }