Esempio n. 1
0
        public void ReloadSettings(string fileNameSettings = null)
        {
            try {
                if (ShouldCancelDbReload())
                {
                    return;
                }

                if (fileNameSettings != null)
                {
                    if (fileNameSettings == ProjectConfiguration.DefaultFileName)
                    {
                        GrfPath.Delete(ProjectConfiguration.DefaultFileName);
                    }

                    ProjectConfiguration.ConfigAsker = new ConfigAsker(fileNameSettings);
                    _recentFilesManager.AddRecentFile(fileNameSettings);
                }

                _setTitle(Methods.CutFileName(ProjectConfiguration.ConfigAsker.ConfigFile), false);

                _loadDatabaseFiles();
                _loadItemTxtFiles();
                _loadItemLuaFiles();
                _cbUseLuaFiles.IsChecked  = ProjectConfiguration.UseLuaFiles;
                _cbClientDbSync.IsChecked = ProjectConfiguration.SynchronizeWithClientDatabases;
                _metaGrfViewer.LoadResourcesInfo();
                _asyncOperation.SetAndRunOperation(new GrfThread(_updateMetaGrf, this, 200, null, false, true));
                IOHelper.Close();
            }
            catch (Exception err) {
                ErrorHandler.HandleException(err);
            }
        }