public event EventHandler<SettingsTO> ConfigurationLoaded; /// <inheritdoc cref="ISettingsProvider.LoadSettingsTO"/> public void LoadSettingsTO(SettingsTO smdSettings) { Verify.IsNotNull(smdSettings, nameof(smdSettings), $"Execution {nameof(this.LoadSettingsTO)} failed."); this.LoadSettingsFromXML(); smdSettings.CoordinateSetFilePath = this.smdSettings.CoordinateSetFilePath; smdSettings.LoadingMotorsConfiguration = this.smdSettings.LoadingMotorsConfiguration; smdSettings.CameraSettings = this.smdSettings.CameraSettings; smdSettings.ImageRestTime = this.smdSettings.ImageRestTime; this.logger.Log( LogLevel.Info, this.loggerTheme, "Configuration successfully loaded from file."); this.logger.Log( LogLevel.Debug, this.loggerTheme, "Configuration loaded: {0}", smdSettings); this.ConfigurationLoaded?.Invoke(this, smdSettings); }
An event is added to the ISettingsProvider interface. This event is fired whenever the settings have been loaded from a file. This is used to inform the other components that the settings have been updated. These new settings then can be used in the other components.