private static void Main(string[] args)
{
Platform.Initialize();
Options.Initialize(args);
Scripting.Initialize();
Encoding.Initalize(TESVSnip.Framework.Properties.Settings.Default.UseUTF8);
try
{
//AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
// Add an event handler for unhandled exception
AppDomain.CurrentDomain.UnhandledException += Program.CurrentDomainUnhandledException;
// Add an event handler for handling UI thread exceptions to the event
//Application.ThreadException += Program.ApplicationThreadException;
TESVSnip.Properties.Settings.Default.Reload();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var main = new MainView();
foreach (string arg in Options.Value.Plugins)
{
main.LoadPlugin(arg);
}
try
{
Application.Run(main);
TESVSnip.Properties.Settings.Default.Save();
}
catch (Exception ex)
{
MessageBox.Show("Error running main window: \n" + ex, Resources.ErrorText);
}
}
catch (Exception ex)
{
MessageBox.Show("Error initializing main view: \n" + ex, Resources.ErrorText);
}
}