终端一体化运控平台
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.
 
 
 

38 lines
1.1 KiB

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