Program.cs 995 Bytes
Newer Older
1 2
using System;
using System.Windows.Forms;
3
using OpenBveApi.FileSystem;
4
using OpenBveApi.Interface;
5 6 7 8

namespace TrainEditor {
	internal static class Program {

9 10 11 12 13 14 15 16 17
		// --- members ---

		/// <summary>Information about the file system organization.</summary>
		internal static FileSystem FileSystem = null;

		// --- functions ---

		/// <summary>Is executed when the program starts.</summary>
		/// <param name="args">The command-line arguments.</param>
18
		[STAThread]
19
		private static void Main(string[] args) {
20 21
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
22 23 24 25
			try {
				FileSystem = FileSystem.FromCommandLineArgs(args);
				FileSystem.CreateFileSystem();
			} catch (Exception ex) {
26
				MessageBox.Show(Translations.GetInterfaceString("errors_filesystem_invalid") + Environment.NewLine + Environment.NewLine + ex.Message, "TrainEditor", MessageBoxButtons.OK, MessageBoxIcon.Hand);
27 28
				return;
			}
29 30 31 32 33
			Application.Run(new formEditor());
		}
		
	}
}