protected static NewSBEEventOWP defineFrom(OldSBEEventOWP evt) { NewSBEEventOWP ret = defineFrom((OldSBEEvent)evt).CloneBySerializationWithType <NewSBEEvent, NewSBEEventOWP>(); if (evt.eventsOWP == null || evt.eventsOWP.Count < 1) { return(ret); } int count = evt.eventsOWP.Count; ret.Match = new MatchWords[count]; for (int i = 0; i < count; ++i) { ret.Match[i] = new MatchWords() { Condition = evt.eventsOWP[i].term, Type = (ComparisonType)evt.eventsOWP[i].type }; } return(ret); }
protected void saveData(SBEEventOWP evt) { List<MatchWords> list = new List<MatchWords>(); foreach(DataGridViewRow row in dataGridViewOutput.Rows) { if(row.Cells[owpTerm.Name].Value == null || row.Cells[owpType.Name].Value == null) { continue; } MatchWords m = new MatchWords(); m.Condition = (row.Cells[owpTerm.Name].Value == null)? "" : row.Cells[owpTerm.Name].Value.ToString(); m.Type = (ComparisonType)Enum.Parse(typeof(ComparisonType), row.Cells[owpType.Name].Value.ToString()); list.Add(m); } evt.Match = list.ToArray(); }
protected void renderData(SBEEventOWP evt) { dataGridViewOutput.Rows.Clear(); if(evt.Match == null) { return; } foreach(MatchWords m in evt.Match) { dataGridViewOutput.Rows.Add(m.Condition, m.Type.ToString()); } }