Beispiel #1
0
		public void Add(Group group)
		{
			group.Id = Interlocked.Increment(ref this.nextGroupId);
			this.Groups.Add(group.Id, group);
			this.GroupList.Add(group);
			group.Framework = this.framework;
			this.framework.eventServer.OnLog(group);
		}
Beispiel #2
0
		public GroupEvent(Event obj, Group group)
		{
			this.Obj = obj;
			this.Group = group;
			if (group != null)
			{
				this.GroupId = group.Id;
				return;
			}
			this.GroupId = -1;
		}
Beispiel #3
0
		public override object Read(BinaryReader reader)
		{
			reader.ReadByte();
			string name = reader.ReadString();
			reader.ReadInt32();
			Group group = new Group(name);
			int num = reader.ReadInt32();
			for (int i = 0; i < num; i++)
			{
				string name2 = reader.ReadString();
				byte type = reader.ReadByte();
				object value = this.streamerManager.Deserialize(reader);
				group.Add(name2, type, value);
			}
			return group;
		}
Beispiel #4
0
 public bool OnNewGroup(Group group)
 {
     if (!group.Fields.ContainsKey("Pad"))
         return false;
     this.table[group.Id] = new GroupItem(group);
     List<Group> list = null;
     int key = (int)group.Fields["Pad"].Value;
     if (!this.orderedGroupTable.TryGetValue(key, out list))
     {
         list = new List<Group>();
         this.orderedGroupTable[key] = list;
     }
     list.Add(group);
     InvokeAction(delegate
     {
         if (!group.Fields.ContainsKey("SelectorKey"))
             return;
         string str = (string)group.Fields["SelectorKey"].Value;
         #if GTK
         if (this.cbxSelector.ContainsText(str))
             return;
         this.cbxSelector.AppendText(str);
         this.eventsBySelectorKey[str] = new List<GroupEvent>();
         this.freezeUpdate = true;
         if (this.cbxSelector.Model.IterNChildren() == 1)
             this.cbxSelector.Active = 0;
         #else
         if (this.cbxSelector.Items.Contains(str))
             return;
         this.cbxSelector.Items.Add(str);
         this.eventsBySelectorKey[str] = new List<GroupEvent>();
         this.freezeUpdate = true;
         if (this.cbxSelector.Items.Count == 1)
             this.cbxSelector.SelectedIndex = 0;
         #endif
         this.freezeUpdate = false;
     });
     return true;
 }
Beispiel #5
0
		private void ProcessGroup(IGroupListener listener, Group group)
		{
			if (listener.OnNewGroup(group))
			{
				List<IGroupListener> list = this.listenerTable[group.Id];
				if (list == null)
				{
					list = new List<IGroupListener>();
					this.listenerTable[group.Id] = list;
				}
				this.groupByListenerTable[listener].Add(group.Id);
				list.Add(listener);
				foreach (GroupEvent current in group.Events)
				{
					listener.Queue.Enqueue(current);
				}
			}
		}
 public GroupEventAgrs(Group group)
 {
     this.Group = group;
 }
Beispiel #7
0
        private void AddGroups()
        {
            // Create bars group.
            barsGroup = new Group("Bars");
            barsGroup.Add("Pad", DataObjectType.String, 0);
            barsGroup.Add("SelectorKey", Instrument.Symbol);

            // Create fills group.
            fillGroup = new Group("Fills");
            fillGroup.Add("Pad", 0);
            fillGroup.Add("SelectorKey", Instrument.Symbol);

            // Create equity group.
            equityGroup = new Group("Equity");
            equityGroup.Add("Pad", 1);
            equityGroup.Add("SelectorKey", Instrument.Symbol);

            // Create BBU group.
            bbuGroup = new Group("BBU");
            bbuGroup.Add("Pad", 0);
            bbuGroup.Add("SelectorKey", Instrument.Symbol);
            bbuGroup.Add("Color", Color.Blue);

            // Create BBL group.
            bblGroup = new Group("BBL");
            bblGroup.Add("Pad", 0);
            bblGroup.Add("SelectorKey", Instrument.Symbol);
            bblGroup.Add("Color", Color.Blue);

            // Create SMA group.
            smaGroup = new Group("SMA");
            smaGroup.Add("Pad", 0);
            smaGroup.Add("SelectorKey", Instrument.Symbol);
            smaGroup.Add("Color", Color.Yellow);

            // Add groups to manager.
            GroupManager.Add(barsGroup);
            GroupManager.Add(fillGroup);
            GroupManager.Add(equityGroup);
            GroupManager.Add(bbuGroup);
            GroupManager.Add(bblGroup);
            GroupManager.Add(smaGroup);
        }
Beispiel #8
0
 private int GetViewerIndex(Group group, int padNumber)
 {
     var list1 = this.orderedGroupTable[padNumber];
     List<Group> list2;
     Dictionary<int, List<Group>> dictionary;
     var selected = GetComboBoxSelected();
     if (!this.drawnGroupTable.TryGetValue(selected, out dictionary))
     {
         dictionary = new Dictionary<int, List<Group>>();
         this.drawnGroupTable[selected] = dictionary;
     }
     if (!dictionary.TryGetValue(padNumber, out list2))
     {
         dictionary[padNumber] = new List<Group>() { group };
         return 0;
     }
     else
     {
         bool flag = false;
         for (int i = 0; i < list2.Count; ++i)
         {
             Group group1 = list2[i];
             if (group1 != group && list1.IndexOf(group) < list1.IndexOf(group1))
             {
                 list2.Insert(i, group1);
                 return i;
             }
         }
         if (flag)
             return 0;
         list2.Add(group);
         return list2.Count - 1;
     }
 }
Beispiel #9
0
 public void Log(DataObject data, Group group)
 {
     this.framework.eventServer.OnLog(new GroupEvent(data, group));
 }
Beispiel #10
0
		internal void OnGroup(Group group)
		{
		}
Beispiel #11
0
 public void Log(DataObject data, Group group)
 {
     this.strategy.Log(data, group);
 }