GlobalFunction.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows.Threading;
  8. namespace HistoryDLL
  9. {
  10. public class GlobalFunction
  11. {
  12. public static bool isSolutionUsing4K = false;
  13. public static bool isUseRightToLeftText = false;
  14. //跟目錄路徑
  15. public static string rootPath = System.AppDomain.CurrentDomain.BaseDirectory;
  16. //專案名稱
  17. public static string projectname = Assembly.GetExecutingAssembly().GetName().Name;
  18. //Data 路徑
  19. public static string dataPath = rootPath + @"Data\";
  20. public static string historyWalldataFolderName = "HistoryWallPage";
  21. //Setting 路徑
  22. public static string settingPath => dataPath + $"{historyWalldataFolderName}\\Setting\\";
  23. //Thumb 路徑
  24. public static string thumbPath => dataPath + $"{historyWalldataFolderName}\\Thumb\\";
  25. //資料路徑預設
  26. public static string JsonFilePath => GlobalFunction.dataPath + $"{historyWalldataFolderName}\\HistoryWallData\\HistoryFile.ini";
  27. //圖片路徑
  28. public static string EventFileImgPath => GlobalFunction.dataPath + $"{historyWalldataFolderName}\\HistoryImage\\";
  29. //ConfigSetting.ini
  30. public static string ConfigSettingFilePath => settingPath + @"ConfigSetting.ini";
  31. //setting file 下的 .txt
  32. public static string CanChangeLangPath => settingPath + @"ChangeLan.txt";
  33. public static string CanHomeClickPath => settingPath + @"HomeClick.txt";
  34. public static string AutoRunVelocityPath => settingPath + @"Velocity.txt";
  35. public static string UsingDisplayOn4KsPath => settingPath + @"UsingViewerConfigFor4K.txt";
  36. //圖片規格
  37. public static string[] imgDimList = { ".jpg", ".png", ".bmp", ".jpeg" };
  38. //影片規格
  39. public static string[] mediaDimList = { ".avi", ".mp4", "mpeg", ".mpg", ".wmv" };
  40. //判斷自動輪播的 Timer
  41. public static DispatcherTimer CheckAutoRunTimer = new DispatcherTimer();
  42. public static bool IsVideoPlay = false;
  43. public static bool isVideoPlay
  44. {
  45. set
  46. {
  47. if (value)
  48. {
  49. CheckAutoRunTimer.Stop();
  50. }
  51. else
  52. {
  53. CheckAutoRunTimer.Start();
  54. }
  55. IsVideoPlay = value;
  56. }
  57. get { return IsVideoPlay; }
  58. }
  59. }
  60. }