private void AddSignalReply(Signal s) { Int32 parentID = s.InReplyTo.SignalID; SignalPanel parent = null; foreach (Control c in this.flowLayoutPanel1.Controls) { if (!(c is SignalPanel)) continue; SignalPanel sp = c as SignalPanel; if (sp.SignalID == parentID) { parent = sp; } } if (parent == null) { parent = new SignalPanel(s.InReplyTo); parent.MinimumSize = new Size(this.flowLayoutPanel1.Width - 30, 64); parent.MaximumSize = new Size(this.flowLayoutPanel1.Width - 30, 300); this.flowLayoutPanel1.Controls.Add(parent); } parent.AddReply(s); }
private void AddSignalPanel(Signal s) { SignalPanel sp = new SignalPanel(s); sp.MinimumSize = new Size(this.flowLayoutPanel1.Width - 30, 64); sp.MaximumSize = new Size(this.flowLayoutPanel1.Width - 30, 300); this.flowLayoutPanel1.Controls.Add(sp); }
/// <summary> /// Populate the response object from the JsonDict. /// </summary> public void Parse() { MemoryStream ms = new MemoryStream(); DataContractJsonSerializer j = new DataContractJsonSerializer(typeof(JsonDict)); j.WriteObject(ms, fObjectDict); ms.Flush(); ms.Seek(0, SeekOrigin.Begin); if (fClass == "signal") { j = new DataContractJsonSerializer(typeof(Signal)); fSignal = (Signal)j.ReadObject(ms); } }
private void GotASignal(Signal s) { if (!fSignalMap.ContainsKey(s.SignalID)) { fSignalMap.Add(s.SignalID, s); } if (s.InReplyTo != null) { try { s.InReplyTo = fSignalMap[s.InReplyTo.SignalID]; this.BeginInvoke(new UICallback(AddSignalReply), new object[] { s }); } catch (KeyNotFoundException) { this.BeginInvoke(new UICallback(AddSignalPanel), new object[] { s }); } } else { this.BeginInvoke(new UICallback(AddSignalPanel), new object[] { s }); } }