终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

40 regels
1.3 KiB

  1. using BPASmartClient.Helper;
  2. using BPASmartClient.Model;
  3. using Microsoft.Toolkit.Mvvm.ComponentModel;
  4. using Model;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace BPASmartClient.MilkWithTea.ViewModel
  12. {
  13. public class MainWindowVeiwModel : ObservableObject
  14. {
  15. public bool AutoStart { get { return SystemHelper.GetInstance.IsAutoStart(); } set { SystemHelper.GetInstance.AutoStart(value); OnPropertyChanged(); } }
  16. public MainWindowVeiwModel()
  17. {
  18. init();
  19. }
  20. private void init()
  21. {
  22. string path = Path.Combine(Environment.CurrentDirectory, "AccessFile", "Recipes");
  23. //判断文件夹是否存在,如果不存在就创建file文件夹
  24. if (!Directory.Exists(path))
  25. {
  26. Directory.CreateDirectory(path);
  27. }
  28. GLobal.recipePath = Path.Combine(path, "LocalRecipes.json");
  29. GLobal.posionPath = Path.Combine(path, "MaterialPosion.json");
  30. GLobal.MaterialRecipes = GLobal.GetJsonToT<LocalTeaWithMilkConfig>(GLobal.recipePath);
  31. GLobal.deviceConfig = GLobal.GetJsonToT<DeviceConfigModelJson>($"{LocaPath.GetInstance().GetDeviceConfigPath}奶茶味魔方.json");
  32. }
  33. }
  34. }