Ejemplo n.º 1
0
        private void InitMercury()
        {
            mercury = new MercuryServer();

            string ofdIPParameter = ConfigurationManager.AppSettings["ofdIP"];

            if (ofdIPParameter != null)
            {
                mercury.OfdIP = ofdIPParameter;
            }

            string ofdPortParameter = ConfigurationManager.AppSettings["ofdPort"];
            int    ofdPort          = 0;

            if (ofdPortParameter != null && Int32.TryParse(ofdPortParameter, out ofdPort))
            {
                mercury.OfdPort = ofdPort;
            }

            string ofdTimerParameter = ConfigurationManager.AppSettings["ofdTimer"];
            int    ofdTimer          = 0;

            if (ofdTimerParameter != null && Int32.TryParse(ofdTimerParameter, out ofdTimer))
            {
                mercury.OfdTimer = ofdTimer;
            }

            string fnTimerParameter = ConfigurationManager.AppSettings["fnTimer"];
            int    fnTimer          = 0;

            if (fnTimerParameter != null && Int32.TryParse(fnTimerParameter, out fnTimer))
            {
                mercury.FnTimer = fnTimer;
            }

            string ofdDocIPParameter = ConfigurationManager.AppSettings["ofdDocIP"];

            if (ofdDocIPParameter != null)
            {
                mercury.OfdDocIP = ofdDocIPParameter;
            }

            string mercuryLogParameter = ConfigurationManager.AppSettings["mercuryLog"];
            bool   mercuryLog          = false;

            if (mercuryLogParameter != null && Boolean.TryParse(mercuryLogParameter, out mercuryLog))
            {
                mercury.MercuryLog = mercuryLog;
            }
        }