Ejemplo n.º 1
0
        /// <summary> Workaround to avoid static initializer </summary>
        private static bool Init()
        {
            // string exeName = AppDomain.CurrentDomain.FriendlyName;
            string entryName    = Assembly.GetEntryAssembly().GetName().Name;
            string entryVersion = Assembly.GetEntryAssembly().GetName().Version.ToString();
            string pixelEngine  = nameof(PixelEngine);

            TempPath     = Path.Combine(Path.GetTempPath(), pixelEngine, $"{entryName}.{entryVersion}");
            AppDataPath  = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), entryName);
            UserDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Documents", entryName);

            if (!Directory.Exists(TempPath))
            {
                Directory.CreateDirectory(TempPath);
            }
            if (!Directory.Exists(AppDataPath))
            {
                Directory.CreateDirectory(AppDataPath);
            }
            if (!Directory.Exists(UserDataPath))
            {
                Directory.CreateDirectory(UserDataPath);
            }

            ResxHelper.LoadDll();
            return(true);
        }
Ejemplo n.º 2
0
        static Windows()
        {
            TempPath = Path.Combine(Path.GetTempPath(), $"{nameof(PixelEngine)}.{Assembly.GetExecutingAssembly().GetName().Version}");

            if (!Directory.Exists(TempPath))
            {
                Directory.CreateDirectory(TempPath);
            }

            ResxHelper.LoadDll();
        }