59 lines
1.6 KiB
C#
Raw Normal View History

2016-12-25 21:43:22 +03:00
using System;
using System.Collections.Generic;
using System.Linq;
2017-01-26 23:40:46 +03:00
using System.Threading;
using System.Threading.Tasks;
2016-12-25 21:43:22 +03:00
using System.Windows.Forms;
2017-01-26 23:40:46 +03:00
using System.IO;
using System.Reflection;
2016-12-25 21:43:22 +03:00
using System.Globalization;
2017-01-26 23:40:46 +03:00
2016-12-25 21:43:22 +03:00
namespace CsbBuilder
{
2017-01-26 23:40:46 +03:00
static class Program
2016-12-25 21:43:22 +03:00
{
2017-01-26 23:40:46 +03:00
public static string ProjectsPath
2016-12-25 21:43:22 +03:00
{
2017-01-26 23:40:46 +03:00
get
2016-12-25 21:43:22 +03:00
{
2017-01-26 23:40:46 +03:00
return Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Projects");
2016-12-25 21:43:22 +03:00
}
2017-01-26 23:40:46 +03:00
}
2016-12-25 21:43:22 +03:00
2017-01-26 23:40:46 +03:00
public static string ApplicationVersion
{
get
2016-12-25 21:43:22 +03:00
{
2017-01-26 23:40:46 +03:00
AssemblyName assemblyName = Assembly.GetEntryAssembly().GetName();
return $"{assemblyName.Name} (Version {assemblyName.Version.ToString()})";
2016-12-25 21:43:22 +03:00
}
2017-01-26 23:40:46 +03:00
}
2016-12-25 21:43:22 +03:00
2017-01-26 23:40:46 +03:00
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
if (args.Length > 0)
2016-12-25 21:43:22 +03:00
{
2017-01-26 23:40:46 +03:00
Audio.AdxConverter.ConvertToWav(args[0]);
return;
2016-12-25 21:43:22 +03:00
}
2017-01-26 23:40:46 +03:00
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
Application.ThreadException += OnException;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
2016-12-25 21:43:22 +03:00
}
2017-01-26 23:40:46 +03:00
private static void OnException(object sender, ThreadExceptionEventArgs e)
2016-12-25 21:43:22 +03:00
{
2017-01-26 23:40:46 +03:00
new ExceptionForm(e.Exception).ShowDialog();
Application.Exit();
2016-12-25 21:43:22 +03:00
}
}
}