public StandardValuesDropDown(IWindowsFormsEditorService editorService, ICollection values) { InitializeComponent(); this.editorService = editorService; UpdateSearchTextBoxState(); foreach (var value in values) { var standardValue = value as StandardValue; if (standardValue == null) standardValue = new StandardValue(GetDisplayTextFromValue(value), value); this.Add(standardValue, false); } this.values = this.values.OrderBy(value => value.DisplayText).ToList(); this.UpdateFilteredListboxItems(); }
public void Add(StandardValue value, bool shouldUpdateListBoxItems) { if (!string.IsNullOrEmpty(value.DisplayText)) { this.values.Add(value); if (shouldUpdateListBoxItems) this.UpdateFilteredListboxItems(); } }
public void Add(StandardValue value) { this.Add(value, true); }