using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;

namespace HistoryDLL
{
    public class GlobalFunction
    {
        public static bool isSolutionUsing4K = false;
        public static bool isUseRightToLeftText = false;
        //跟目錄路徑
        public static string rootPath = System.AppDomain.CurrentDomain.BaseDirectory;
        //專案名稱
        public static string projectname = Assembly.GetExecutingAssembly().GetName().Name;
        //Data 路徑
        public static string dataPath = rootPath + @"Data\";
        public static string historyWalldataFolderName = "HistoryWallPage";
        //Setting 路徑
        public static string settingPath => dataPath + $"{historyWalldataFolderName}\\Setting\\";
        //Thumb 路徑
        public static string thumbPath => dataPath + $"{historyWalldataFolderName}\\Thumb\\";

        //資料路徑預設
        public static string JsonFilePath => GlobalFunction.dataPath + $"{historyWalldataFolderName}\\HistoryWallData\\HistoryFile.ini";
        //圖片路徑
        public static string EventFileImgPath => GlobalFunction.dataPath + $"{historyWalldataFolderName}\\HistoryImage\\";

        //ConfigSetting.ini
        public static string ConfigSettingFilePath => settingPath + @"ConfigSetting.ini";

        //setting file 下的 .txt
        public static string CanChangeLangPath => settingPath + @"ChangeLan.txt";
        public static string CanHomeClickPath => settingPath + @"HomeClick.txt";
        public static string AutoRunVelocityPath => settingPath + @"Velocity.txt";
        public static string UsingDisplayOn4KsPath => settingPath + @"UsingViewerConfigFor4K.txt";

        //圖片規格
        public static string[] imgDimList = { ".jpg", ".png", ".bmp", ".jpeg" };
        //影片規格
        public static string[] mediaDimList = { ".avi", ".mp4", "mpeg", ".mpg", ".wmv" };

        //判斷自動輪播的 Timer 
        public static DispatcherTimer CheckAutoRunTimer = new DispatcherTimer();

        public static bool IsVideoPlay = false;

        public static bool isVideoPlay
        {
            set
            {
                if (value)
                {
                    CheckAutoRunTimer.Stop();
                }
                else
                {
                    CheckAutoRunTimer.Start();
                }

                IsVideoPlay = value;
            }
            get { return IsVideoPlay; }
        }

    }
}
