using BPASmartClient.MorkCL.Server; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BPASmartClient.MorkCL.HelpClass { public class FuncParHelpClass:FuncPar { private bool _IsUseComboBox; /// /// 根据参数名称,判断是否使用组合框。 /// public bool IsUseComboBox { get { return _IsUseComboBox; } set { _IsUseComboBox = value; } } private ObservableCollection _ComboBoxItemsSource; public ObservableCollection ComboBoxItemsSource { get { return _ComboBoxItemsSource; } set { _ComboBoxItemsSource = value;} } /// /// 参数数据源。 /// public static Dictionary> ParOptions { get; } = new Dictionary>() { //{"搅拌速度",new ObservableCollection(){10,20,30,40,50 } }, //{"加热档位",new ObservableCollection {1,2,3,4,5,6,7,8} }, {"调料名称",new ObservableCollection( SqliteHelper.GetInstance.GetSeasoning()) }, {"主料名称",new ObservableCollection( SqliteHelper.GetInstance.GetIngredients()) }, {"辅料名称",new ObservableCollection( SqliteHelper.GetInstance.GetAccessories()) }, //{"设置炒制位",new ObservableCollection {1,2,3,4} }, }; public static ObservableCollection GetParOptions(string paramName) { if (paramName is null) { throw new ArgumentNullException("paramName", "参数名称不可为空"); } ObservableCollection parOption; switch (paramName) { case "调料名称": parOption = new ObservableCollection(SqliteHelper.GetInstance.GetSeasoning()); break; case "主料名称": parOption = new ObservableCollection(SqliteHelper.GetInstance.GetIngredients()); break; case "辅料名称": parOption = new ObservableCollection(SqliteHelper.GetInstance.GetAccessories()); break; default: parOption = new(); break; } return parOption; } } }