示例#1
0
 void EntryValidation_Changed(object sender, EventArgs e)
 {
     if (_maxLength > 0 || _maxWords > 0)
     {
         ValidateMaxLenghtMaxWordsResult result = FrameworkUtils.ValidateMaxLenghtMaxWords(Text, _initialLabelText, _maxLength, _maxWords);
         Text       = result.Text;
         Label.Text = result.LabelText;
         _length    = result.Length;
         _words     = result.Words;
     }
 }
示例#2
0
        void Value_Changed(object sender, EventArgs e)
        {
            if (_maxLength > 0 || _maxWords > 0)
            {
                ValidateMaxLenghtMaxWordsResult result = FrameworkUtils.ValidateMaxLenghtMaxWords(_entryMultiline.Value.Text, _initialLabelText, _maxLength, _maxWords);
                //Only update if changes else infinite loop
                if (_entryMultiline.Value.Text != result.Text)
                {
                    _entryMultiline.Value.Text = result.Text;
                }
                Label.Text = result.LabelText;
                _length    = result.Length;
                _words     = result.Words;
            }

            //Now we can validate after ValidateMaxLenghtMaxWords Work
            Validate();
        }