using System;
using System.IO;

namespace Earthblend.Tts.Common.Core.Statics
{
    public static class VirtualSystemUtil
    {
        static VirtualSystemUtil()
        {
            ImageFolder = PicturesPath();
            DataStorageFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\";
            ExportsStorageFolder = DataStorageFolder + ApplicationFolderName + ExportsStorageFolder;
            DataModelsStorageFolder = DataStorageFolder + ApplicationFolderName + DataModelsFolderName;
            AppImagesStorageFolder = DataStorageFolder + ApplicationFolderName + AppImagesFolderName;
            TextureStorageFolder = DataStorageFolder + ApplicationFolderName + TextureFolderName;
            TestCodeStorageFolder = DataStorageFolder + ApplicationFolderName + TestCodeFolderName;
            ApplicationStorageFolder = DataStorageFolder + ApplicationFolderName;


            //if (!Directory.Exists(DataStorageFolder + ApplicationFolderName + TextureFolderName))
            //{
            //    Directory.CreateDirectory(DataStorageFolder + ApplicationFolderName + TextureFolderName);
            //}
            //if (!Directory.Exists(DataStorageFolder + ApplicationFolderName + DataModelsFolderName))
            //{
            //    Directory.CreateDirectory(DataStorageFolder + ApplicationFolderName);
            //}
        }

        public static String AppImagesStorageFolder { get; set; }
        public static String DataStorageFolder { get; set; }
        public static String ExportsStorageFolder { get; set; }
        public static String DataModelsStorageFolder { get; set; }
        public static String TextureStorageFolder { get; set; }
        public static String TestCodeStorageFolder { get; set; }
        public static String ApplicationStorageFolder { get; set; }


        public static String ApplicationFolderName { get; set; } = @"MathCompiler3D\";
        public static String TestCodeFolderName { get; set; } = @"TestCode\";
        public static String DataModelsFolderName { get; set; } = @"DataModels\";
        public static String AppImagesFolderName { get; set; } = @"AppImages\";
        public static String TextureFolderName { get; set; } = @"Textures\";
        public static String ExportsFolderName { get; set; } = @"Exports\";

        //private static String _resourceDrive = @"C:\";
        //private static String _systemDrive = @"C:\";
        //private static String _dataDrive = @"C:\";
        public static String ImageFolder { get; set; }
        //public static String GetImageDrive()
        //{
        //    return ImageFolder + @"\DataTts\Textures\";
        //}

        //public static String GetResourceDrive()
        //{
        //    return _resourceDrive;
        //}

        private static String PicturesPath()
        {
            //const String userRoot = "HKEY_CURRENT_USER";
            //const String subkey = @"Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\";
            //const String keyName = userRoot + "\\" + subkey;

            //String str = (String)Microsoft.Win32.Registry.GetValue(keyName, "My Pictures", "Unknown");
            return @"C:\";
        }
    }

    //public static class VirtualSystemUtil
    //{
    //    static VirtualSystemUtil()
    //    {
    //        ImageFolder = PicturesPath();
    //    }

    //    private static String _resourceDrive = @"C:\";
    //    private static String _systemDrive = @"C:\";
    //    private static String _dataDrive = @"C:\";
    //    public static String ImageFolder { get; set; }
    //    public static String GetImageDrive()
    //    {
    //        return ImageFolder + @"\DataTts\Textures\";
    //    }

    //    public static String GetResourceDrive()
    //    {
    //        return _resourceDrive;
    //    }

    //    private static String PicturesPath()
    //    {
    //        //const String userRoot = "HKEY_CURRENT_USER";
    //        //const String subkey = @"Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\";
    //        //const String keyName = userRoot + "\\" + subkey;

    //        //String str = (String)Microsoft.Win32.Registry.GetValue(keyName, "My Pictures", "Unknown");
    //        return @"C:\";
    //    }
    //}
}
