private void DeserilizeObjects() { try { pmaInfo = PMAInfo.Deserialize(File.ReadAllText(Path.Combine(configManager.CurrentAppConfigDir, PMAInfo.PMA_INFO_FILE))); emailsInfo = Emails.Deserialize(File.ReadAllText(Path.Combine(configManager.CurrentAppConfigDir, Emails.EMAILS_INFO_FILE))); smtpInfo = SmtpInfo.Deserialize(File.ReadAllText(Path.Combine(configManager.CurrentAppConfigDir, SmtpInfo.SMTP_INFO_FILE))); ftpInfo = FTPInfo.Deserialize(File.ReadAllText(Path.Combine(configManager.CurrentAppConfigDir, FTPInfo.FTP_INFO_FILE))); } catch (Exception ex) { throw ex; } }
//---------------------------------------------------------------------------------------------------------------------------- /// <summary> /// Deserilizes the infos. /// </summary> private void DeserilizePMAInfo() { configManager.Logger.Debug(EnumMethod.START); try { configManager.PMAInfoObj = PMAInfo.Deserialize(File.ReadAllText(Path.Combine(configManager.CurrentAppConfigDir, PMAInfo.PMA_INFO_FILE))); } catch (FileNotFoundException ex) { throw ex; } finally { configManager.Logger.Debug(EnumMethod.END); } }
//-------------------------------------------------------------------------------------------- /// <summary> /// Initilizes the PMA object. /// </summary> private void InitilizePMAObject() { if (PMAInfoObj == null) { if (File.Exists(Path.Combine(CurrentAppConfigDir, PMAInfo.PMA_INFO_FILE))) { PMAInfoObj = PMAInfo.Deserialize(File.ReadAllText(Path.Combine(CurrentAppConfigDir, PMAInfo.PMA_INFO_FILE))); } else { PMAInfoObj = new PMAInfo(); PMAInfoObj.MailingTime = DateTime.Now; PMAInfoObj.TriggerSeed = 1; PMAInfoObj.ReportsIntervalHours = 1; } } }