private void ResfreshMessages() { var mainParam = new NoParam(); var globalContains = new ContainsParam(containsQuery.Text); mainParam.AddChild(globalContains); SearchParametrs globalMinLevel; try { globalMinLevel = new HasMinimumLevelParam(Convert.ToInt32(minLevelQuery.Text)); } catch (System.FormatException e) { globalMinLevel = new NoParam(); } globalContains.AddChild(globalMinLevel); foreach (DataGridViewRow row in ClientView.Rows) { if (row.Cells["Search"].Value == null || (bool)row.Cells["Search"].Value == false) { continue; } SearchParametrs childHasGuid; childHasGuid = new lib.HasGuidParam(new Guid(row.Cells["Guid"].Value as string)); globalMinLevel.AddChild(childHasGuid); var childContains = new lib.ContainsParam(Convert.ToString(row.Cells["Contains"].Value)); childHasGuid.AddChild(childContains); SearchParametrs childMinLevel; try { childMinLevel = new lib.HasMinimumLevelParam(Convert.ToInt32(row.Cells["MinLevel"].Value)); } catch (FormatException e) { childMinLevel = new NoParam(); } childContains.AddChild(childMinLevel); } messages = history.Receive(mainParam).ToList(); MessagesView.DataSource = messages; }
private void ResfreshMessages() { var mainParam = new NoParam(); var globalContains = new ContainsParam(containsQuery.Text); mainParam.AddChild(globalContains); SearchParametrs globalMinLevel; try { globalMinLevel = new HasMinimumLevelParam(Convert.ToInt32(minLevelQuery.Text)); } catch (System.FormatException e) { globalMinLevel = new NoParam(); } globalContains.AddChild(globalMinLevel); foreach (DataGridViewRow row in ClientView.Rows) { if (row.Cells["Search"].Value == null || (bool)row.Cells["Search"].Value == false) { continue; } SearchParametrs childHasGuid; childHasGuid = new lib.HasGuidParam(new Guid(row.Cells["Guid"].Value as string)); globalMinLevel.AddChild(childHasGuid); var childContains = new lib.ContainsParam(Convert.ToString(row.Cells["Contains"].Value)); childHasGuid.AddChild(childContains); SearchParametrs childMinLevel; try { childMinLevel = new lib.HasMinimumLevelParam(Convert.ToInt32(row.Cells["MinLevel"].Value)); } catch(FormatException e) { childMinLevel = new NoParam(); } childContains.AddChild(childMinLevel); } messages = history.Receive(mainParam).ToList(); MessagesView.DataSource = messages; }