public bool Apply(out string message)
        {
            if (!File.Exists(applicationManager.SettingFile) ||
                !indexDatabaseSettingProvider.Validate(out string m))
            {
                wApplicationSettings.SetProvider(indexDatabaseSettingProvider);
                wApplicationSettings.ShowDialog();
            }
            var result = true;

            indexDatabaseSettingProvider.LoadOptions();
            if (!File.Exists(applicationManager.SettingFile))
            {
                result  = false;
                message = "Missing database configurations.";
            }
            else if (!indexDatabaseSettingProvider.Validate(out m))
            {
                result  = false;
                message = "Could not connect database at the moment.";
            }
            else
            {
                result  = true;
                message = "Success";
            }

            return(result);
        }
Example #2
0
        public async Task <bool> Apply()
        {
            if (!File.Exists(applicationManager.SettingFile) || !(await indexDatabaseSettingProvider.Validate()))
            {
                Message = indexDatabaseSettingProvider.Message;
                wApplicationSettings.SetProvider(indexDatabaseSettingProvider);
                wApplicationSettings.ShowDialog();
                resolverFactory.Release(wApplicationSettings);
            }
            var result = true;

            indexDatabaseSettingProvider.LoadOptions();
            if (!File.Exists(applicationManager.SettingFile))
            {
                result  = false;
                Message = "Missing database configurations.";
            }
            else if (!await indexDatabaseSettingProvider.Validate())
            {
                result  = false;
                Message = "Could not connect database at the moment.";
            }
            else
            {
                result  = true;
                Message = "Success";
            }

            return(result);
        }