private async Task SetValidValue(bool IsDynamicChange = false) { if (!ShowCheckBox &&…
- User
private async Task SetValidValue(bool IsDynamicChange = false) { if (!ShowCheckBox && !AllowMultiSelection) { if (InputBaseObj != null) { await InputBaseObj.SetValue(Text, FloatLabelType, ShowClearButton); } string id = currentValue.Count != 0 ? currentValue.FirstOrDefault()?.ToString()! : string.Empty; if ((TreeObj == null && !showPopupTree) || (TreeObj?.SelectedNodes.Length == 0) || (TreeObj?.SelectedNodes.FirstOrDefault() != id)) { selectedNodes = new string[] { id }; } await InvokeMethod("sfBlazor.DropDownTree.updateSelectedValue", new object[] { dataId, currentValue, false }); } else { List? tempCurrentValue = currentValue?.Select(item => (string)SfBaseUtils.ChangeType(item, typeof(string)))?.ToList(); if (ShowCheckBox) { List? tempCheckedNodes = checkedNodes?.Select(item => (TValue)SfBaseUtils.ChangeType(item, typeof(TValue)))?.ToList(); List difference = currentValue?.Where(item => tempCheckedNodes?.IndexOf(item) == -1)?.ToList()!; if (difference.Count > 0 || AutoUpdateCheckState) { if (showPopupTree && tempCurrentValue != null) await TreeObj!.CheckAllAsync(tempCurrentValue.ToArray()); else if (tempCurrentValue != null) { checkedNodes = tempCurrentValue.ToArray(); if (AutoUpdateCheckState) { List result = new(tempCurrentValue); GetChild(tempCurrentValue, result); GetParents(tempCurrentValue, result); result = result.Distinct().ToList(); checkedNodes = result.ToArray(); } } await SetMultiSelect(IsDynamicChange, true); } } else { if (!showPopupTree && tempCurrentValue != null) selectedNodes = tempCurrentValue.ToArray(); await UpdateSelectedValues(!string.IsNullOrEmpty(Text)); } } }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.