Exemplo n.º 1
0
        public static TryLoadCommonGlobalSettings LoadMonitorCommonGlobalSettings()
        {
            var loadFromJsonResult = LoadFromJson();

            if (!loadFromJsonResult.IsComplete)
            {
                return(new TryLoadCommonGlobalSettings(false, loadFromJsonResult.Message));
            }

            string exceptionMsg;

            if (!SqlWorks.CheckSQL_Connection(MainSettings.JsonSettings.ConnectionString, out exceptionMsg))
            {
                return(new TryLoadCommonGlobalSettings(false, $"Ошибка подключения к SQL-базе заданий.\r\nПричина: {exceptionMsg}"));
            }

            _globalSettings = new CommonGlobalSettings();
            return(_globalSettings.LoadCommonGlobalSettings());
        }
Exemplo n.º 2
0
 public static TryLoadCommonGlobalSettings LoadAgentCommonGlobalSettings()
 {
     _globalSettings = new CommonGlobalSettings();
     return(_globalSettings.LoadCommonGlobalSettings());
 }