Пример #1
0
        private static void Main()
        {
            CurrentHost = new Host();

            try
            {
                FileSystem = FileSystem.FromCommandLineArgs(new string[0]);
                FileSystem.CreateFileSystem();
            }
            catch (Exception ex)
            {
                MessageBox.Show(Translations.GetInterfaceString("errors_filesystem_invalid") + Environment.NewLine + Environment.NewLine + ex.Message, Translations.GetInterfaceString("program_title"), MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }

            Interface.LoadOptions();

            Sounds = new Sounds();
            Sounds.Initialize(CurrentHost, SoundRange.Medium);

            if (!Plugins.LoadPlugins())
            {
                Sounds.Deinitialize();
                return;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FormEditor());

            Plugins.UnloadPlugins();
            Sounds.Deinitialize();

            Interface.SaveOptions();
        }