Ejemplo n.º 1
0
        public Main()
        {
            g_oBatman = new BatchManager();
            try
            {
                string sSetupXMLPath = AppSettings.App_Path() + AppSettings.App_Name() + "Setup.xml";
                Logging.LogMessage("Constructor::SetupXMLPath, " + sSetupXMLPath);
                XMLSettings.LoadBaseSettings(sSetupXMLPath);
                XMLSettings.LoadDefaults(sSetupXMLPath);

                g_oBatman.NewBatchProcess += G_oBatman_NewBatchProcess;
            }
            catch (Exception ex)
            {
                // Unable to write to log when the error can not find the workingPath
                Logging.LogMessage(String.Format("Exception: {0}, occured in {1}: {2}", ex.InnerException, ex.TargetSite, ex.Message));
            }
            InitializeComponent();
        }
Ejemplo n.º 2
0
        public batchService()
        {
            g_oBatman = new BatchManager();

            timer.Interval = 60000;
            timer.Elapsed += Timer_Elapsed;;
            timer.Enabled  = true;

            try
            {
                string sSetupXMLPath = AppSettings.App_Path() + AppSettings.App_Name() + "Setup.xml";
                Logging.LogMessage("Constructor::SetupXMLPath, " + sSetupXMLPath);
                Logging.WriteToEventLog("Constructor::SetupXMLPath, " + sSetupXMLPath);
                XMLSettings.LoadBaseSettings(sSetupXMLPath);
                XMLSettings.LoadDefaults(sSetupXMLPath);
            }
            catch (Exception ex)
            {
                Logging.WriteToEventLog(String.Format("Exception: {0}, occured in {1}: {2}", ex.InnerException, ex.TargetSite, ex.Message), "batchService", EventLogEntryType.Error);
                // Unable to write to log when the error can not find the workingPath
                //LogMessage(String.Format("Exception: {0}, occured in {1}: {2}", ex.InnerException, ex.TargetSite, ex.Message));
            }
            InitializeComponent();
        }
Ejemplo n.º 3
0
        private void UpdateUI()
        {
            txt_batchclass.Text = BatchClass.Name;

            XMLPath = AppSettings.App_Path() + AppSettings.App_Name() + "Setup.xml";
            XMLSettings.LoadBaseSettings(XMLPath);
            XMLSettings.LoadDefaults(XMLPath);
            XMLSettings.LoadXMLSettings(XMLPath, BatchClass.Name.Replace(" ", ""));

            Logging.LogMessage("UpdateUI::DoneLoadingXMLSettings");

            // Defaults
            cb_shortdateformat.Items.AddRange(XMLSettings.g_aShortDateFormat_DEF);
            cb_longdateformat.Items.AddRange(XMLSettings.g_aLongDateFormat_DEF);
            cb_shorttimeformat.Items.AddRange(XMLSettings.g_aShortTimeFormat_DEF);
            cb_longtimeformat.Items.AddRange(XMLSettings.g_aLongTimeFormat_DEF);
            cb_localizationvalue.Items.AddRange(XMLSettings.g_aLocalizationValue_DEF);
            cb_timestringtoformat.Items.AddRange(XMLSettings.g_aTimeStringToFormat_DEF);
            cb_formatteddate.Items.AddRange(XMLSettings.g_aFormattedDate_DEF);
            cb_formattedtime.Items.AddRange(XMLSettings.g_aFormattedTime_DEF);
            cb_targetdateformat.Items.AddRange(XMLSettings.g_aTargetDateFormat_DEF);
            cb_targettimeformat.Items.AddRange(XMLSettings.g_aTargetTimeFormat_DEF);
            cb_usewaterfallformatter.Items.AddRange(XMLSettings.g_aUseWaterfallFormater_DEF);
            cb_usedistancerule.Items.AddRange(XMLSettings.g_aUseDistanceRule_DEF);
            cb_distanceruledays.Items.AddRange(XMLSettings.g_aDistanceRuleDays_DEF);
            cb_distancerulefuture.Items.AddRange(XMLSettings.g_aDistanceRuleFuture_DEF);

            // Reset combobox selected index
            cb_shortdateformat.SelectedIndex    = 0;
            cb_longdateformat.SelectedIndex     = 0;
            cb_shorttimeformat.SelectedIndex    = 0;
            cb_longtimeformat.SelectedIndex     = 0;
            cb_localizationvalue.SelectedIndex  = 0;
            cb_timestringtoformat.SelectedIndex = 0;
            cb_timestringtoformat.Items.Add("Browse ...");
            cb_formatteddate.SelectedIndex         = 0;
            cb_formattedtime.SelectedIndex         = 0;
            cb_targetdateformat.SelectedIndex      = 0;
            cb_targettimeformat.SelectedIndex      = 0;
            cb_usewaterfallformatter.SelectedIndex = 0;
            cb_usedistancerule.SelectedIndex       = 0;
            cb_distanceruledays.SelectedIndex      = 0;
            cb_distancerulefuture.SelectedIndex    = 0;

            // Value Assignments
            txt_shortdateformat.Text   = XMLSettings.g_sShortDateFormat;
            txt_longdateformat.Text    = XMLSettings.g_sLongDateFormat;
            txt_shorttimeformat.Text   = XMLSettings.g_sShortTimeFormat;
            txt_longtimeformat.Text    = XMLSettings.g_sLongTimeFormat;
            txt_localizationvalue.Text = XMLSettings.g_sLocalizationValue;
            txt_stringtoformat.Text    = XMLSettings.g_sTimeStringToFormat;
            txt_formatteddate.Text     = XMLSettings.g_sFormattedDate;
            txt_formattedtime.Text     = XMLSettings.g_sFormattedTime;

            // Settings
            txt_targetdateformat.Text      = XMLSettings.g_sTargetDateFormat;
            txt_targettimeformat.Text      = XMLSettings.g_sTargetTimeFormat;
            txt_usewaterfallformatter.Text = XMLSettings.g_bUseWaterfallFormatter.ToString();
            txt_usedistancerule.Text       = XMLSettings.g_bUseDistanceRule.ToString();
            txt_ruledays.Text           = XMLSettings.g_iDistanceRuleDays.ToString();
            txt_distancerulefuture.Text = XMLSettings.g_bDistanceRuleFuture.ToString();

            //Waterfall Check Priority
            txt_format1.Text = XMLSettings.g_aMethodOrder[0];
            if (XMLSettings.g_aMethodOrder.Count > 1)
            {
                txt_format2.Text = XMLSettings.g_aMethodOrder[1];
            }
            if (XMLSettings.g_aMethodOrder.Count > 2)
            {
                txt_format3.Text = XMLSettings.g_aMethodOrder[2];
            }
            if (XMLSettings.g_aMethodOrder.Count > 3)
            {
                txt_format4.Text = XMLSettings.g_aMethodOrder[3];
            }

            // Internal variable setup
            g_aNewMethodOrder = XMLSettings.g_aMethodOrder;
            g_aTxtMethodOrder = new List <TextBox>();
            g_aTxtMethodOrder.Add(txt_format1);
            g_aTxtMethodOrder.Add(txt_format2);
            g_aTxtMethodOrder.Add(txt_format3);
            g_aTxtMethodOrder.Add(txt_format4);

            Logging.LogMessage("UpdateUI::FinishedUpdating");
        }