AdministrationWindow: Use GetHashCode() to compare default/original values
This commit is contained in:
@ -217,19 +217,19 @@ namespace Elwig.Helpers {
|
||||
SelectCheckComboBoxItems(ccb, getId, items?.Select(i => getId(i)));
|
||||
}
|
||||
|
||||
public static object? GetInputValue(Control input) {
|
||||
public static int GetInputHashCode(Control input) {
|
||||
if (input is TextBox tb) {
|
||||
return tb.Text;
|
||||
return Utils.GetEntityIdentifier(tb.Text);
|
||||
} else if (input is ComboBox sb) {
|
||||
return sb.SelectedItem;
|
||||
return Utils.GetEntityIdentifier(sb.SelectedItem);
|
||||
} else if (input is Xceed.Wpf.Toolkit.CheckComboBox ccb) {
|
||||
return ccb.SelectedItems.Cast<object>().ToArray();
|
||||
return Utils.GetEntityIdentifier(ccb.SelectedItems);
|
||||
} else if (input is CheckBox cb) {
|
||||
return cb.IsChecked?.ToString();
|
||||
return Utils.GetEntityIdentifier(cb.IsChecked);
|
||||
} else if (input is RadioButton rb) {
|
||||
return rb.IsChecked?.ToString();
|
||||
return Utils.GetEntityIdentifier(rb.IsChecked);
|
||||
} else {
|
||||
return null;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user