/// <summary> /// Opens the Settings.xml file and reads its settings. /// </summary> private void ReadSettings() { Trace.WriteLine("ReadSettings called...", "ReadSettings"); try { companiesFilePath = Path.Combine(Application.StartupPath, "Companies.xml"); this.logFolder = TestApp.Properties.Settings.Default["Logging"].ToString(); this.watchFolder = TestApp.Properties.Settings.Default["WatchFolder"].ToString(); this.localQueuePath = TestApp.Properties.Settings.Default["LocalQueuePath"].ToString(); this.maxQueueRetry = Convert.ToInt32(TestApp.Properties.Settings.Default["MaxQueueRetry"].ToString()); Trace.WriteLine("Reading Companies...", "ReadSettings"); this.xmlSettings = new XMLSettingsReader(this.companiesFilePath); xmlSettings.ReadXML(); Trace.WriteLine("Reading Companies complete", "ReadSettings"); } catch (Exception ex) { Trace.WriteLine(String.Format("ReadSettings Failed. Error: {0}" + ex.Message), "ReadSettings"); //this.Stop(); } }
/// <summary> /// Opens the Settings.xml file and reads its settings. /// </summary> private void ReadSettings() { Trace.WriteLine("ReadSettings called...", "ReadSettings"); try { companiesFilePath = Path.Combine(Application.StartupPath, "Companies.xml"); Parameters_DataTransfer.LogFolder = VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["Logging"].ToString(); Parameters_DataTransfer.OutboxFolder = VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["WatchFolder"].ToString(); Parameters_DataTransfer.QueueFolder = VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["QueueFolder"].ToString(); Parameters_DataTransfer.LocalQueuePath = VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["LocalQueuePath"].ToString(); Parameters_DataTransfer.InboxFolder = VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["InboxFolder"].ToString(); Parameters_DataTransfer.MaxQueueRetry = Convert.ToInt32(VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["MaxQueueRetry"].ToString()); Parameters_DataTransfer.TempFolder = VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["TempFolder"].ToString(); Parameters_DataTransfer.ProcessedFolder = VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["ProcessedFolder"].ToString(); Parameters_DataTransfer.FailedFolder = VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["FailedFolder"].ToString(); Parameters_DataTransfer.SAPLoginSettings.SAP_AppServerHost = VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["SAP_AppServerHost"].ToString(); Parameters_DataTransfer.SAPLoginSettings.SAP_Client = VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["SAP_Client"].ToString(); Parameters_DataTransfer.SAPLoginSettings.SAP_SystemID = VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["SAP_SystemID"].ToString(); Parameters_DataTransfer.SAPLoginSettings.SAP_SystemNumber = VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["SAP_SystemNumber"].ToString(); Parameters_DataTransfer.SAPLoginSettings.SAP_User = VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["SAP_User"].ToString(); Parameters_DataTransfer.SAPLoginSettings.SAP_Password = VanLeeuwen.Projects.WebPortal.DataTransferService.Properties.Settings.Default["SAP_Password"].ToString(); Trace.WriteLine("Reading Companies...", "ReadSettings"); this.xmlSettings = new XMLSettingsReader(this.companiesFilePath); xmlSettings.ReadXML(); Trace.WriteLine("Reading Companies complete", "ReadSettings"); } catch (Exception ex) { Trace.WriteLine(String.Format("ReadSettings Failed. Error: {0}" + ex.Message), "ReadSettings"); this.Stop(); } }