void FinishStartup()
        {
            if (_log.IsDebugEnabled)
            {
                _log.DebugFormat("Starting {0}", MethodBase.GetCurrentMethod().ToString());
            }
            ModManagement.DoInitialSetup();
            //while (ModManagement.SetupInProgress)
            //{
            //    System.Threading.Thread.Sleep(100);
            //}
            string path = System.IO.Path.Combine(Locations.DataPath, "audio.ini");

            AudioConfiguration audioConfig =
                INIConverter.ToObject(path, typeof(AudioConfiguration)) as AudioConfiguration;

            if (audioConfig.StartupMusic)
            {
                string playfile = Path.Combine(Locations.ArtemisCopyPath, "dat", "Artemis Main Screen.ogg");

                if (File.Exists(playfile))
                {
                    RussLibraryAudio.AudioServer.Current.PlayAsync(playfile);
                }
            }


            this.Dispatcher.BeginInvoke(new Action(ModManagement.UpdateCheckProcess), System.Windows.Threading.DispatcherPriority.Loaded);
            this.Dispatcher.BeginInvoke(new Action <AudioConfiguration>(LoadAudioData), audioConfig);
            this.Dispatcher.BeginInvoke(new Action(DoStartup));
            if (_log.IsDebugEnabled)
            {
                _log.DebugFormat("Ending {0}", MethodBase.GetCurrentMethod().ToString());
            }
        }
 public void LoadSettings()
 {
     AudioConfig = INIConverter.ToObject(configurationPath, typeof(AudioConfiguration)) as AudioConfiguration;
     AudioConfig.SetAudioCollection();
     if (AudioConfig.AudioCollection.Count == 0)
     {
         AudioConfig.LoadDefault();
         AudioConfig.ResetAudioServer();
     }
     AudioConfig.AcceptChanges();
 }
        static UserConfiguration()
        {
            bool DataConverted = false;

            if (File.Exists(Locations.ConfigFile))
            {
                using (StreamReader sr = new StreamReader(Locations.ConfigFile))
                {
                    string sLine = sr.ReadLine();
                    if (!sLine.Contains("="))
                    {
                        Current = new UserConfiguration();
                        Current.ArtemisInstallPath = sLine;
                        if (!string.IsNullOrEmpty(Current.ArtemisInstallPath))
                        {
                            if (!File.Exists(Path.Combine(Current.ArtemisInstallPath, Locations.ArtemisEXE)))
                            {
                                Current.ArtemisInstallPath = Locations.FindArtemisInstallPath();
                            }
                        }
                        if (sLine != null)
                        {
                            sLine = sr.ReadLine();
                            if (!string.IsNullOrEmpty(sLine))
                            {
                                bool b;
                                if (bool.TryParse(sLine, out b))
                                {
                                    Current.UseArtemisExtender = b;
                                }
                            }
                            if (sLine != null)
                            {
                                sLine = sr.ReadLine();
                                Current.ArtemisExtenderPath = sLine;
                                if (sLine != null)
                                {
                                    sLine = sr.ReadLine();
                                    Current.ArtemisExtenderCopy = sLine;
                                }
                            }
                        }
                        DataConverted = true;
                    }
                }
            }
            if (DataConverted)
            {
                FileHelper.DeleteFile(Locations.ConfigFile);
                Current.Save();
            }
            else
            {
                Current = INIConverter.ToObject(Locations.ConfigFile, new UserConfiguration()) as UserConfiguration;
            }
            if (string.IsNullOrEmpty(Current.ArtemisExtenderCopy) || !File.Exists(Current.ArtemisExtenderCopy))
            {
                Current.UseArtemisExtender = false;
            }
            Current.Original = new UserConfiguration();

            Current.AcceptChanges();
        }