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); }
public GroupEvent(Event obj, Group group) { this.Obj = obj; this.Group = group; if (group != null) { this.GroupId = group.Id; return; } this.GroupId = -1; }
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; }
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; }
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; }
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); }
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; } }
public void Log(DataObject data, Group group) { this.framework.eventServer.OnLog(new GroupEvent(data, group)); }
internal void OnGroup(Group group) { }
public void Log(DataObject data, Group group) { this.strategy.Log(data, group); }