public static void PreLoading() { string FileName = Application.StartupPath + "\\" + RdetOutboundAdapterConfigMgt.FileName; Log.WriteAppStart("RdetOutboundAdapter"); //RdetOutboundAdapterConfigMgt.RdetOutAdapterConfig = RdetOutboundAdapterConfigMgt.BuildSampleConfig(); //RdetOutboundAdapterConfigMgt.Save(FileName); if (!RdetOutboundAdapterConfigMgt.Load(FileName)) { Log.Write(LogType.Error, "Load configuration failed. \r\n" + FileName + "\r\n" + RdetOutboundAdapterConfigMgt.LastException.Message); } Database = new DataBase(RdetOutboundAdapterConfigMgt.RdetOutAdapterConfig.GWDataDBConnection); DeviceMgt = new DeviceDirManager(); DeviceMgt.FileName = Application.StartupPath + "\\" + DeviceDirManager.IndexFileName; if (DeviceMgt.LoadDeviceDir()) { Log.Write("Load DeviceDir succeeded. " + DeviceMgt.FileName); } else { Log.Write(LogType.Error, "Load DeviceDir failed. " + DeviceMgt.FileName); } }
public static void PreLoading() { string FileName = Application.StartupPath + "\\" + RdetOutboundAdapterConfigMgt.FileName; //RdetOutboundAdapterConfigMgt.RdetOutAdapterConfig = RdetOutboundAdapterConfigMgt.BuildSampleConfig(); //RdetOutboundAdapterConfigMgt.Save(FileName); //LoadConfigXMLFile(); if (!RdetOutboundAdapterConfigMgt.Load(FileName)) { log.Write(LogType.Error, "Cannot Load Configuration file: " + FileName); if (MessageBox.Show("Cannot load configuration file. Do you want to create an empty configuration file?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { RdetOutboundAdapterConfigMgt.Save(FileName); } } }