终端一体化运控平台
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

54 righe
1.3 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Collections.ObjectModel;
  7. using BPASmartClient.Helper;
  8. namespace BPASmartClient.CustomResource.Pages.Model
  9. {
  10. public class ReportHelper
  11. {
  12. public ObservableCollection<ReportBase> Reports { get; set; } = new ObservableCollection<ReportBase>();
  13. public void Add(ReportBase report)
  14. {
  15. Reports.Add(report);
  16. }
  17. public void Save(string name)
  18. {
  19. DataRecord record = new DataRecord();
  20. record.Save(Reports, name);
  21. }
  22. public void Dispos()
  23. {
  24. Reports.Clear();
  25. }
  26. public ObservableCollection<ReportBase> GetData(string path)
  27. {
  28. DataRecord record = new DataRecord();
  29. return record.Read<ObservableCollection<ReportBase>>(path);
  30. }
  31. }
  32. //public class ReportHelper
  33. //{
  34. // private volatile static ReportHelper _Instance;
  35. // public static ReportHelper GetInstance => _Instance ?? (_Instance = new ReportHelper());
  36. // private ReportHelper() { }
  37. // public object GetData(string path)
  38. // {
  39. // DataRecord record = new DataRecord();
  40. // return record.Read<object>(path);
  41. // }
  42. //}
  43. }