/// <summary> /// Loads the module configuration. /// </summary> private void LoadConfig() { if (File.Exists(configFileName) && !moduleConfig.Load(configFileName, out string errMsg)) { ScadaUiUtils.ShowError(errMsg); } }
/// <summary> /// Performs actions when starting the service. /// </summary> public override void OnServiceStart() { if (ServerContext.Storage.GetFileInfo(DataCategory.Config, ModuleConfig.DefaultFileName).Exists&& !moduleConfig.Load(ServerContext.Storage, ModuleConfig.DefaultFileName, out string errMsg)) { Log.WriteError(ServerPhrases.ModuleMessage, Code, errMsg); } }
/// <summary> /// Performs actions when starting the service. /// </summary> public override void OnServiceStart() { // load configuration file if exists if (ServerContext.Storage.GetFileInfo(DataCategory.Config, ModuleConfig.DefaultFileName).Exists&& !moduleConfig.Load(ServerContext.Storage, ModuleConfig.DefaultFileName, out string errMsg)) { Log.WriteError(ServerPhrases.ModuleMessage, Code, errMsg); } if (moduleConfig.UseDefaultDir) { moduleConfig.SetToDefault(AppDirs.InstanceDir); } Log.WriteInfo(Locale.IsRussian ? "Архив в формате DAT: {0}" : "Archive in DAT format: {0}", moduleConfig.ArcDir); Log.WriteInfo(Locale.IsRussian ? "Копия архива в формате DAT: {0}" : "Archive copy in DAT format: {0}", moduleConfig.ArcCopyDir); }