public LiveBoxConfig(TextBox targetTextBox, string displayMember, LiveBoxSelectAction selectAction, string valueMember) { this.TargetTextBox = targetTextBox; this.DisplayMember = displayMember; this.SelectionType = selectAction; this.ValueMember = valueMember; }
public void AttachToControl(TextBox targetTextBox, string displayMember, LiveBoxSelectAction selectAction, string valueMember = null) { var config = new LiveBoxConfig(targetTextBox, displayMember, selectAction, valueMember); liveBoxConfigs.Add(config); config.TargetTextBox.KeyDown += TargetTextBox_KeyDown; config.TargetTextBox.LostFocus += TargetTextBox_LostFocus; config.TargetTextBox.ReadOnlyChanged += TargetTextBox_ReadOnlyChanged; config.TargetTextBox.TextChanged += TargetTextBox_TextChanged; }