private void OptionSetSelectorDialog_Load(object sender, EventArgs e) { Enable(false); if (OptionSets == null) { OptionSets = "organization_currencyformatcode|quote_statuscode"; } Enable(false); ChkListBoxOptionSets.BeginUpdate(); ChkListBoxOptionSets.Items.Clear(); try { if (string.IsNullOrWhiteSpace(OptionSets)) { return; } OptionSets = OptionSets.Replace(" ", string.Empty); foreach (var optionSet in OptionSets.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries)) { ChkListBoxOptionSets.Items.Add(optionSet, false); } } finally { ChkListBoxOptionSets.EndUpdate(); Enable(true); } }
private void OptionSetSelectorDialog_Load(object sender, EventArgs e) { Enable(false); if (OptionSets == null) { OptionSets = new HashSet <string> { "organization_currencyformatcode", "quote_statuscode" }; } Enable(false); ChkListBoxOptionSets.BeginUpdate(); ChkListBoxOptionSets.Items.Clear(); try { ChkListBoxOptionSets.Items.AddRange(OptionSets.Cast <object>().ToArray()); } finally { ChkListBoxOptionSets.EndUpdate(); Enable(true); } }