Exemple #1
0
 public void TestDisplayingRelatedProperty()
 {
     SetupClassDefs(true);
     _cb     = GetControlFactory().CreateCheckBox();
     _mapper = new CheckBoxMapper(_cb, "MyRelationship.MyRelatedTestProp", true, GetControlFactory());
     _mapper.BusinessObject = itsMyBo;
     Assert.IsNotNull(_mapper.BusinessObject);
     Assert.AreEqual(true, _cb.Checked);
 }
        /// <summary>
        /// Adds click event handler
        /// </summary>
        /// <param name="mapper">The checkbox mapper</param>
        public void AddClickEventHandler(CheckBoxMapper mapper)
        {
            var checkBox = mapper.GetControl() as CheckBox;

            if (checkBox == null)
            {
                return;
            }

            checkBox.CheckedChanged += delegate
            {
                try
                {
                    mapper.ApplyChangesToBusinessObject();
                    mapper.UpdateControlValueFromBusinessObject();
                }
                catch (Exception ex)
                {
                    GlobalRegistry.UIExceptionNotifier.Notify(ex, "", "Error ");
                }
            };
        }
Exemple #3
0
 public void SetupTest()
 {
     _cb     = CreateCheckBox();
     _mapper = new CheckBoxMapper(_cb, "SampleBoolean", false, GetControlFactory());
     _sampleBusinessObject = new Sample();
 }