/// <summary> /// Creates a new numeric binary operation holder control. /// </summary> public Control_BinaryOperationHolder(Profiles.Application application, EvaluatableType evalType) { InitializeComponent(); Application = application; EvalType = evalType; DataContext = this; }
/// <summary> /// Re-creates the list collection view that is used for the expression selection list. /// </summary> private void UpdateExpressionListItems(EvaluatableType t) { ListCollectionView lcv = new ListCollectionView(EvaluatableRegistry .Get(EvaluatableTypeResolver.Resolve(t)) // Get all condition types that match the required type .OrderBy(kvp => (int)kvp.Value.Category) // Order them by the numeric value of the category (so they appear in the order specified) .ThenBy(kvp => kvp.Value.Name) // Then, order the items alphabetically in their category .ToList()); lcv.GroupDescriptions.Add(new PropertyGroupDescription("Value.CategoryStr")); expressionSelection.ItemsSource = lcv; }
public DynamicConstructorParamDefinition(string name, EvaluatableType type, string description = null) { this.name = name; this.type = type; this.description = description; }
/// <summary> /// Creates a new numeric binary operation holder control using the values of the specified enum as the operators item source. /// </summary> public Control_BinaryOperationHolder(Profiles.Application application, EvaluatableType evalType, Type enumType) : this(application, evalType) { operatorSelection.ItemsSource = Utils.EnumUtils.GetEnumItemsSource(enumType); }
public static IEvaluatable GetDefault(EvaluatableType inType) => enumToDefaultDictionary.TryGetValue(inType, out Func <IEvaluatable> outFunc) ? outFunc() : null;
public static Type Resolve(EvaluatableType inType) => enumToTypeDictionary.TryGetValue(inType, out Type outType) ? outType : typeof(IEvaluatable);