This commit is contained in:
Алексей Тихоненков 2024-09-05 15:25:41 +04:00
parent 079f196dcf
commit 4794158d40
2 changed files with 14 additions and 21 deletions

View File

@ -34,19 +34,17 @@ namespace WinFormsLibrary1
{ {
get get
{ {
string checkedItems = "";
for (int i = 0; i < checkedListBox.Items.Count; i++) if (checkedListBox.SelectedItem != null)
{ {
if (checkedListBox.GetItemChecked(i)) return checkedListBox.SelectedItem.ToString();
{ }
checkedItems += checkedListBox.Items[i].ToString() + " "; else
} {
} return "";
if (checkedListBox.CheckedItems != null) }
return checkedItems;
else }
return "";
}
set set
{ {
for (int i = 0; i < checkedListBox.Items.Count; i++) for (int i = 0; i < checkedListBox.Items.Count; i++)

View File

@ -53,16 +53,11 @@ namespace COP
set set
{ {
if (!minValue.HasValue || !maxValue.HasValue) if (!minValue.HasValue || !maxValue.HasValue || value < minValue || value > maxValue)
{ {
throw new NoRangeException("Диапозон не был задан");
}
if (value < minValue || value > maxValue)
{
return; return;
}
}
dateTimePicker.Value = value.Value; dateTimePicker.Value = value.Value;