private SearchCombox CreateSearchCombox(JiraField field) { var cb = new SearchCombox(); cb.DisplayMember = "Name"; cb.ValueMember = "Value"; cb.TabIndex = 99 - CurrentFieldCount; //cb.Width = 230; cb.Tag = new ControlTagPackage { Field = field, ID = field.Schema.CustomID, }; cb.SelectedIndexChanged = (sender, e) => { var package = cb.Tag as ControlTagPackage; var selectItem = cb.SelectedItem as NameValue; if (package != null && selectItem != null) { cb.Tag = new ControlTagPackage { Field = package.Field, ID = package.ID, SerializedString = String.Format(CUSTOM_FIELD_VALUE_USER_FORMAT, package.ID, selectItem.Value, "{", "}") }; } }; return cb; }
public override List<Control> ProvideControl() { if (m_UserSearch == null) { m_UserSearch = new SearchCombox(); m_UserSearch.DisplayMember = "DisplayName"; m_UserSearch.ValueMember = "Name"; m_UserSearch.SelectedIndexChanged += GroupSearch_SelectedIndexChanged; } return new List<Control>() { m_UserSearch }; }