示例#1
0
        public void PreLoading(EntityInitializeArgument arg)
        {
            AppArgument = arg;

            Log = new LogControler(arg.GetLogFileName(AppName), arg.LogConfig);
            LogHelper.EnableApplicationLogging(Log);
            LogHelper.EnableXmlLogging(Log);
            SocketHelper.EnableSocketLogging(Log, arg.LogConfig.DumpData);
            Log.WriteAppStart(AppName);
            Log.Write(arg.ToLog());

            string FileName = ConfigHelper.GetFullPath(Path.Combine(arg.ConfigFilePath, HL7OutboundConfig.HL7OutboundConfigFileName));

            ConfigMgr = new ConfigManager <HL7OutboundConfig>(FileName);

            if (ConfigMgr.Load())
            {
                Log.Write("Load config succeeded. " + ConfigMgr.FileName);
            }
            else
            {
                Log.Write(LogType.Error, "Load config failed. " + ConfigMgr.FileName);
                Log.Write(LogType.Error, ConfigMgr.LastError.ToString());

                if (System.Windows.Forms.MessageBox.Show("Cannot load " + AppName + " configuration file. \r\n" +
                                                         ConfigMgr.FileName + "\r\n\r\nDo you want to create a configuration file with default setting and continue?",
                                                         AppName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    CreateDefaultConfig();
                }
            }
        }
示例#2
0
        internal static void PreLoading()
        {
            Log = new Logging(Application.StartupPath + "\\XIMOutbound.log");
            LoggingHelper.EnableApplicationLogging(Log);
            LoggingHelper.EnableXmlLogging(Log);
            Log.WriteAppStart(AppName);

            ConfigMgt          = new XIMOutboundConfigMgt();
            ConfigMgt.FileName = Application.StartupPath + "\\" + ConfigMgt.FileName;
            if (ConfigMgt.Load())
            {
                Log.Write("Load config succeeded. " + ConfigMgt.FileName);
            }
            else
            {
                Log.Write(LogType.Error, "Load config failed. " + ConfigMgt.FileName);
                ConfigMgt.Config = new XIMOutboundConfig();
                ConfigMgt.Save();
            }

            XIMTransformHelper.EnableXSLTLogging(Log);
            SocketHelper.EnableSocketLogging(Log, ConfigMgt.Config.DumpSocketData);
        }