// The rest... protected override void ConvertText2Value() { string completedtext = AutoCompletionTools.AutoCompleteIntegral(this.Text, false); completedtext = completedtext.Trim(); bool valid = Int16.TryParse(completedtext, out Int16 value_candidate); if (valid == false) { return; } if (Int16.TryParse(this.MinValue, out Int16 minvalue)) { if (value_candidate < minvalue) { return; } } if (Int16.TryParse(this.MaxValue, out Int16 maxvalue)) { if (value_candidate > maxvalue) { return; } } this.Value = value_candidate; }
// The rest... protected override void ConvertText2Value() { string completedtext = AutoCompletionTools.AutoCompleteIntegral(this.Text, true); completedtext = completedtext.Trim(); if (completedtext == "") { this.Value = null; return; } bool valid = Byte.TryParse(completedtext, out Byte value_candidate); if (valid == false) { return; } if (Byte.TryParse(this.MinValue, out Byte minvalue)) { if (value_candidate < minvalue) { return; } } if (Byte.TryParse(this.MaxValue, out Byte maxvalue)) { if (value_candidate > maxvalue) { return; } } this.Value = value_candidate; }