Ejemplo n.º 1
0
        private void Options_FormClosed(object sender, FormClosedEventArgs e)
        {
            CoreSettings.Save();

            new Task(() =>
            {
                NLogConfig.ReloadFileLoggingRule();
                gui.ResetGUI();
                gui.DrawPackages();
            }).Start();
        }
Ejemplo n.º 2
0
        private void GUI_Load(object sender, EventArgs e)
        {
            try
            {
                //setting file check
                String config_path = (AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
                if (!File.Exists(config_path))
                {
                    File.WriteAllText(config_path, Resources.Config);
                    MessageBox.Show("Setting file was missing. Please restart the application.");
                    Environment.Exit(0);
                }

                //nlog init
                NLogConfig.SetDefaultConfig();
                logger = LogManager.GetLogger("GUI");
                Debug.Assert(logger != null);


                //Our stuff
                logger.Info("Startup");
                loadedGpkPackages = new List <GpkPackage>();

                //audio
                waveOut = new WaveOut();
                waveOut.PlaybackStopped += WaveOutOnPlaybackStopped;

                if (Settings.Default.SaveDir == "")
                {
                    Settings.Default.SaveDir = Directory.GetCurrentDirectory();
                }

                if (Settings.Default.OpenDir == "")
                {
                    Settings.Default.OpenDir = Directory.GetCurrentDirectory();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.InnerException.Message);
            }
        }