示例#1
0
        private void IconState(Object sender, EventArgs arg)
        {
            IValidatorData validator = (sender as IValidator).validate();
            TreeNode       node      = (sender as UserControl).Tag as TreeNode;

            Dictionary <ValidatorDataResult, String> NameMap = new Dictionary <ValidatorDataResult, String>();

            NameMap.Add(ValidatorDataResult.Ok, "Default");
            NameMap.Add(ValidatorDataResult.Error, "ExclamationMark");
            NameMap.Add(ValidatorDataResult.Disable, "Error");
            NameMap.Add(ValidatorDataResult.Warning, "Warning");

            try
            {
                node.ImageKey         = NameMap[validator.result];
                node.SelectedImageKey = NameMap[validator.result];
                node.ToolTipText      = validator.message;
            }
            catch (Exception)
            {
                node.ImageKey         = "Help";
                node.SelectedImageKey = "Help";
            }
        }
 public ValitatorDateTests()
 {
     simpleValidator = new SimpleValidator();
     validatorData   = new ValidatorData(simpleValidator);
 }