mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-14 20:34:08 +02:00
55 lines
1.6 KiB
C#
55 lines
1.6 KiB
C#
using CefSharp;
|
|
using System;
|
|
using System.Globalization;
|
|
using System.IO;
|
|
using System.Windows.Forms;
|
|
using TweetDick.Configuration;
|
|
using TweetDick.Core;
|
|
using TweetDick.Migration;
|
|
|
|
namespace TweetDick{
|
|
static class Program{
|
|
public static readonly string StoragePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),"TweetDick");
|
|
public static readonly UserConfig UserConfig;
|
|
|
|
private static string HeaderAcceptLanguage{
|
|
get{
|
|
string culture = CultureInfo.CurrentCulture.Name;
|
|
|
|
if (culture == "en"){
|
|
return "en-us,en";
|
|
}
|
|
else{
|
|
return culture.ToLowerInvariant()+",en;q=0.9";
|
|
}
|
|
}
|
|
}
|
|
|
|
static Program(){
|
|
UserConfig = UserConfig.Load(Path.Combine(StoragePath,"TD_UserConfig.cfg"));
|
|
}
|
|
|
|
[STAThread]
|
|
private static void Main(){
|
|
Application.EnableVisualStyles();
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
|
MigrationManager.Run();
|
|
|
|
Cef.Initialize(new CefSettings{
|
|
AcceptLanguageList = HeaderAcceptLanguage,
|
|
UserAgent = "TweetDick "+Application.ProductVersion,
|
|
Locale = CultureInfo.CurrentCulture.TwoLetterISOLanguageName,
|
|
CachePath = StoragePath
|
|
});
|
|
|
|
Application.Run(new FormBrowser());
|
|
|
|
Application.ApplicationExit += (sender, args) => {
|
|
UserConfig.Save();
|
|
Cef.Shutdown();
|
|
};
|
|
}
|
|
}
|
|
}
|