Habanero.Faces.Win.ComboBoxKeyPressMapperStrategyWin.AddHandlers C# (CSharp) Method

AddHandlers() public method

Adds event handlers to the ComboBox that are suitable for the UI environment
public AddHandlers ( IComboBoxMapper mapper ) : void
mapper IComboBoxMapper The mapper for the lookup ComboBox
return void
        public void AddHandlers(IComboBoxMapper mapper)
        {
            _mapper = mapper;
            var comboBoxWin = mapper.GetControl();
            if (comboBoxWin != null)
            {
                comboBoxWin.KeyPress += ComboBoxWinOnKeyPressHandler();
            }
        }

Usage Example

 public void Test_AddHandlers_WhenMapperUsingHabaneroControl_ShouldAddBehaviours()
 {
     //---------------Set up test pack-------------------
     var comboBoxWin = new ComboBoxWin {Name = "TestComboBox", Enabled = true};
     var comboBoxMapper = new ComboBoxMapperStub(comboBoxWin);
     //---------------Assert Precondition----------------
     Assert.IsInstanceOf<IComboBox>(comboBoxMapper.Control);
     //---------------Execute Test ----------------------
     var comboBoxStrategyWin = new ComboBoxKeyPressMapperStrategyWin();
     comboBoxStrategyWin.AddHandlers(comboBoxMapper);
     //---------------Assert Result----------------------
     Assert.IsTrue(true, "If an error was not thrown then we are OK");
 }
All Usage Examples Of Habanero.Faces.Win.ComboBoxKeyPressMapperStrategyWin::AddHandlers