private void SetupUserValueInput() { UserValueIsVisible = false; UserDropdownValueIsVisible = false; KeybindIsVisible = false; // Event operators don't have any form of input if (SelectedOperator.Value == "changed" || SelectedOperator.Value == "decreased" || SelectedOperator.Value == "increased") { return; } if (SelectedDataModelProp.Type != null && SelectedDataModelProp.Type.Contains("hotkey")) { KeybindIsVisible = true; } else if (SelectedDataModelProp.Type == "Boolean") { UserDropdownValueIsVisible = true; } else if (SelectedDataModelProp.EnumValues != null) { DropdownValues.Clear(); DropdownValues.AddRange(SelectedDataModelProp.EnumValues); UserDropdownValueIsVisible = true; } else { UserValueIsVisible = true; } }
public void SetupPropertyInput() { Operators.Clear(); DropdownValues.Clear(); switch (SelectedDataModelProp.Type) { case "Int32": case "Single": Operators.AddRange(_int32Operators); UserValueIsVisible = true; break; case "Boolean": Operators.AddRange(_boolOperators); DropdownValues.Add("True"); DropdownValues.Add("False"); UserDropdownValueIsVisible = true; break; case "String": Operators.AddRange(_stringOperators); UserValueIsVisible = true; break; default: Operators.AddRange(_operators); UserValueIsVisible = true; break; } // If the selected value is in a list, prefix all choices with list choices if (SelectedDataModelProp.Path != null && SelectedDataModelProp.Path.Contains("(")) { var listOperators = new List <NamedOperator>(); foreach (var o in Operators) { listOperators.AddRange(_listOperatorsPrefixes.Select(p => new NamedOperator(p.Display + " " + o.Display.ToLower(), p.Value + "|" + o.Value))); } Operators.Clear(); Operators.AddRange(listOperators); } // Add Changed operator is the type is event if (_editorViewModel.ProposedLayer.IsEvent) { Operators.Add(new NamedOperator("Changed", "changed")); // Also add decreased and increased operator on numbers if (SelectedDataModelProp.Type == "Int32" || SelectedDataModelProp.Type == "Single") { Operators.Add(new NamedOperator("Decreased", "decreased")); Operators.Add(new NamedOperator("Increased", "increased")); } } SetupUserValueInput(); }
public void SetupPropertyInput() { Operators.Clear(); DropdownValues.Clear(); switch (SelectedDataModelProp.Type) { case "Int32": case "Single": Operators.AddRange(_int32Operators); UserValueIsVisible = true; break; case "Boolean": Operators.AddRange(_boolOperators); DropdownValues.Add("True"); DropdownValues.Add("False"); UserDropdownValueIsVisible = true; break; case "String": Operators.AddRange(_stringOperators); UserValueIsVisible = true; break; default: Operators.AddRange(_operators); UserValueIsVisible = true; break; } // Add Changed operator is the type is event if (_editorViewModel.ProposedLayer.IsEvent) { Operators.Add(new NamedOperator("Changed", "changed")); // Also add decreased and increased operator on numbers if (SelectedDataModelProp.Type == "Int32" || SelectedDataModelProp.Type == "Single") { Operators.Add(new NamedOperator("Decreased", "decreased")); Operators.Add(new NamedOperator("Increased", "increased")); } } SetupUserValueInput(); }