private void WhereOptionsColumn_Changed(object sender, int index, string selectedValue) { try { if (index != (this.uxWhereOptions.Children.Count - 1) && selectedValue == Constants.None) { int endCount = this.uxWhereOptions.Children.Count; for (int x = (index + 1); x < endCount; ++x) { ReplaceWhere removeItem = this.replaceWheres.FirstOrDefault(i => i.Index == x); this.uxWhereOptions.Children.Remove(removeItem); this.replaceWheres.Remove(removeItem); } return; } else if (index == (this.uxWhereOptions.Children.Count - 1) && selectedValue != Constants.None) { this.AddReplaceWhere(); } } catch (Exception err) { MessageBox.Show(err.InnerExceptionMessage()); } }
private void AddWhereItem() { ReplaceWhere whereItem = new ReplaceWhere { Index = this.uxWhere.Children.Count }; whereItem.SetSelectableColumns(this.valueSelectColumns); whereItem.SetValueColumns(this.valueOptionColumns); whereItem.ColumnSelectionChanged += this.WhereOptionsColumn_Changed; this.uxWhere.Children.Add(whereItem); this.selectedWhereOptions.Add(whereItem); }
private void AddVauesItem() { ReplaceWhere valueItem = new ReplaceWhere { Index = this.uxValues.Children.Count }; valueItem.SetSelectableColumns(this.valueSelectColumns); valueItem.SetValueColumns(this.valueOptionColumns); valueItem.ColumnSelectionChanged += this.ValueOptionsColumn_Changed; this.uxValues.Children.Add(valueItem); this.selectedValueOptions.Add(valueItem); }
private void AddReplaceWhere() { ReplaceWhere replaceOption = new ReplaceWhere { Index = this.uxWhereOptions.Children.Count }; replaceOption.SetSelectableColumns(this.whereOptions); replaceOption.SetValueColumns(this.valueColumns); replaceOption.WhereValue = this.WhereHeaderKey; replaceOption.ColumnSelectionChanged += this.WhereOptionsColumn_Changed; this.uxWhereOptions.Children.Add(replaceOption); this.replaceWheres.Add(replaceOption); }