public static bool Load(string fileName) { try { using (StreamReader sr = File.OpenText(fileName)) { string strXml = sr.ReadToEnd(); _FileOutAdapterConfig = XObjectManager.CreateObject(strXml, typeof(FileOutboundAdapterConfig)) as FileOutboundAdapterConfig; return(_FileOutAdapterConfig != null); } } catch (Exception err) { _lastError = err; return(false); } }
public static bool LoadDefault() { _FileOutAdapterConfig = new FileOutboundAdapterConfig(); //General _FileOutAdapterConfig.OutGeneralParams.FilePath = "C:\\FILEOUT"; _FileOutAdapterConfig.OutGeneralParams.FilePrefix = ""; _FileOutAdapterConfig.OutGeneralParams.FileSuffix = ".ini"; _FileOutAdapterConfig.OutGeneralParams.TimerEnable = true; _FileOutAdapterConfig.OutGeneralParams.TimerInterval = 30000; //inbound channel _FileOutAdapterConfig.OutboundChanels.Add(BuildPatientChannel()); _FileOutAdapterConfig.OutboundChanels.Add(BuildOrderChannel()); _FileOutAdapterConfig.OutboundChanels.Add(BuildReportChannel()); return(true); }