private void button1_Click(object sender, EventArgs e) { var corr = new Correlation(textBox1.Text); var lvi = new ListViewItem(textBox1.Text); lvi.Tag = corr.Id; lvi.BackColor = Color.LightYellow; listView1.Items.Insert(0, lvi); Transform_text(corr); }
public void Display(Correlation corr) { for(var i =0; i<listView1.Items.Count; i++) { var lvi = listView1.Items[i]; if ((Guid)lvi.Tag == corr.Id) { lvi.SubItems.Add((string) corr.Data); lvi.BackColor = Color.LightGreen; } } }
protected override void Process(IMessage input, Action<IMessage> continueWith, Action<FlowRuntimeException> unhandledException) { if ("encode decode".IndexOf(input.Port.Name.ToLower()) < 0) throw new ArgumentException("Invalid input port! Valid input ports of Correlator are .encode and .decode."); IMessage msg = null; Correlation corr = null; switch(input.Port.Name.ToLower()) { case "encode": corr = (Correlation)input.Data; msg = new Message(base.Name + ".encoded", corr.Data, corr.Id); break; case "decode": corr = new Correlation(input.CorrelationId, input.Data); msg = new Message(base.Name + ".decoded", corr, corr.Id); break; } msg.Causalities = input.Causalities; msg.FlowStack = input.FlowStack; continueWith(msg); }