| | |
| | | |
| | | private bool ValidateForm() |
| | | { |
| | | bool flag = FormGroupHelper.ValidateForm(formPanel, new Dictionary<string, object> { |
| | | var cache = new Dictionary<string, object> { |
| | | { "FgValue",GetTargetValue()} |
| | | }); |
| | | }; |
| | | bool flag = FormGroupHelper.ValidateForm(formPanel, cache); |
| | | if (flag) |
| | | { |
| | | Data.Name = TbName.Text; |
| | | Data.Type = CbType.Text; |
| | | Data.IsArray = CbIsArray.IsChecked == true; |
| | | Data.Value = GetTargetValue(); |
| | | Data.Unit = TbUnit.Text; |
| | | Data.Description = TbDescription.Text; |
| | |
| | | Data = data; |
| | | TbName.Text = Data.Name; |
| | | CbType.SelectedValue = Data.Type; |
| | | CbIsArray.IsChecked = Data.IsArray; |
| | | CbGroup.ItemsSource = groups; |
| | | UpdateWindow(Data.Type); |
| | | UpdateForm(Data); |
| | |
| | | |
| | | private string GetTargetValue() |
| | | { |
| | | if (CbType.Text == "Int" || Data.Type == "Double") |
| | | var type = CbType.Text; |
| | | if (type == "Int" || type == "Double") |
| | | { |
| | | return NiNumberValue.Text; |
| | | } |
| | | else if (CbType.Text == "Bool") |
| | | else if (type == "Bool") |
| | | { |
| | | return CbBoolValue.Text; |
| | | } |