2016-12-25 19:43:22 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2017-01-26 21:40:46 +01:00
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
2016-12-25 19:43:22 +01:00
|
|
|
|
using System.Windows.Forms;
|
2017-01-26 21:40:46 +01:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Reflection;
|
2016-12-25 19:43:22 +01:00
|
|
|
|
using System.Globalization;
|
2017-01-26 21:40:46 +01:00
|
|
|
|
|
2017-04-17 18:06:29 +02:00
|
|
|
|
using NAudio.Wave;
|
2016-12-25 19:43:22 +01:00
|
|
|
|
|
|
|
|
|
namespace CsbBuilder
|
|
|
|
|
{
|
2017-01-26 21:40:46 +01:00
|
|
|
|
static class Program
|
2016-12-25 19:43:22 +01:00
|
|
|
|
{
|
2017-01-26 21:40:46 +01:00
|
|
|
|
public static string ProjectsPath
|
2016-12-25 19:43:22 +01:00
|
|
|
|
{
|
2017-01-26 21:40:46 +01:00
|
|
|
|
get
|
2016-12-25 19:43:22 +01:00
|
|
|
|
{
|
2017-01-26 21:40:46 +01:00
|
|
|
|
return Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Projects");
|
2016-12-25 19:43:22 +01:00
|
|
|
|
}
|
2017-01-26 21:40:46 +01:00
|
|
|
|
}
|
2016-12-25 19:43:22 +01:00
|
|
|
|
|
2017-04-23 18:22:25 +02:00
|
|
|
|
public static string ApplicationTitle
|
2017-01-26 21:40:46 +01:00
|
|
|
|
{
|
|
|
|
|
get
|
2016-12-25 19:43:22 +01:00
|
|
|
|
{
|
2017-01-26 21:40:46 +01:00
|
|
|
|
AssemblyName assemblyName = Assembly.GetEntryAssembly().GetName();
|
2017-04-23 18:22:25 +02:00
|
|
|
|
return $"CSB Builder {assemblyName.Version.ToString()}";
|
2016-12-25 19:43:22 +01:00
|
|
|
|
}
|
2017-01-26 21:40:46 +01:00
|
|
|
|
}
|
2016-12-25 19:43:22 +01:00
|
|
|
|
|
2017-01-26 21:40:46 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The main entry point for the application.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[STAThread]
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
{
|
|
|
|
|
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
|
2018-06-06 20:46:07 +02:00
|
|
|
|
#if !DEBUG
|
2017-01-26 21:40:46 +01:00
|
|
|
|
Application.ThreadException += OnException;
|
2018-06-06 20:46:07 +02:00
|
|
|
|
#endif
|
2017-01-26 21:40:46 +01:00
|
|
|
|
Application.EnableVisualStyles();
|
|
|
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
|
|
Application.Run(new MainForm());
|
2016-12-25 19:43:22 +01:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-26 21:40:46 +01:00
|
|
|
|
private static void OnException(object sender, ThreadExceptionEventArgs e)
|
2016-12-25 19:43:22 +01:00
|
|
|
|
{
|
2017-01-26 21:40:46 +01:00
|
|
|
|
new ExceptionForm(e.Exception).ShowDialog();
|
2017-09-17 12:02:44 +02:00
|
|
|
|
|
2018-06-06 20:46:07 +02:00
|
|
|
|
if (MessageBox.Show("Do you want to continue?", "CSB Builder", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
|
2017-09-17 12:02:44 +02:00
|
|
|
|
{
|
|
|
|
|
Application.Exit();
|
|
|
|
|
}
|
2016-12-25 19:43:22 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|