/// <summary> /// Initializes the specified settings file name. /// </summary> /// <param name="settingsFileName">Name of the settings file.</param> public void Initialize(string settingsFileName) { if (settingsFileName == null) { throw new ArgumentNullException(nameof(settingsFileName)); } try { IsInitialized = true; RetrieveLocalConfiguration(settingsFileName); LoadExternalAssemblies(); _sendingPModeWatcher = new PModeWatcher <SendingProcessingMode>( Path.Combine(ApplicationPath, configurationfolder, sendpmodefolder), SendingProcessingModeValidator.Instance); _receivingPModeWatcher = new PModeWatcher <ReceivingProcessingMode>( Path.Combine(ApplicationPath, configurationfolder, receivepmodefolder), ReceivingProcessingModeValidator.Instance); _sendingPModeWatcher.Start(); _receivingPModeWatcher.Start(); } catch (Exception exception) { IsInitialized = false; Logger.Fatal(exception.Message); throw; } }
private void PopulateSendingPModeCombobox() { if (_sendPModeWatcher != null) { _sendPModeWatcher.Stop(); PModeCombobox.ItemsSource = new string[] { }; } if (String.IsNullOrWhiteSpace(SendingPModeLocationTextBox.Text)) { return; } _sendPModeWatcher = new PModeWatcher <SendingProcessingMode>(SendingPModeLocationTextBox.Text); _sendPModeWatcher.Start(); PModeCombobox.ItemsSource = _sendPModeWatcher.GetPModes().OrderBy(p => p.Id); }