private void dgv_CellEndEdit(object sender, DataGridViewCellEventArgs e) { if (null != tv.SelectedNode) { string contentTitel = ""; object contentObject = null; Content node = (Content)tv.SelectedNode.Tag; //get the current node node.Items.Clear(); //clear all parameters foreach (DataGridViewRow row in dgv.Rows) //run trough each row { if ((null != row.Cells[0].Value) && (0 < row.Cells[0].Value.ToString().Trim().Length)) { contentTitel = row.Cells[0].Value.ToString(); } if (null != row.Cells[1].Value) { contentObject = row.Cells[1].Value; } if ((0 == contentTitel.Length) && (null == contentObject)) { continue; } ContentString cs = new ContentString(); cs.ContentTitel = contentTitel; cs.ContentObject = row.Cells[1].Value; node.Items.Add(cs); } } }
/// <summary> /// Filter the json using json path expression /// </summary> /// <param name="filterText">json path expression</param> /// <returns>returns the IEnumerable<string> which matched the json path expression against the content</returns> public IEnumerable <string> FilterJsonContent(string filterText) => ContentString .ApplyJsonPathExpression(filterText);