예제 #1
0
        /// <summary>
        /// Used to set the application to the the most recent value in the file.
        /// </summary>
        /// <param name="names"></param>
        /// <param name="counters"></param>
        /// <param name="stoppedTotal"></param>
        /// <param name="numCntrs"></param>
        public void setAll(string[] names, string[] counters, string stoppedTotal, int numCntrs)
        {
            string[] tmpSpn            = new string[3];
            int      currentTimerTexts = DISPLAY.returnTextBoxList().Length;

            //set correct number of timers
            if (numCntrs < currentTimerTexts)
            {
                //I commented this out. I can't figure out why it can't delete rows so now it just defaults in.
                //for (int i = 0; i < currentTimerTexts - numCntrs; i++) DISPLAY.deleteRow();
            }
            else
            {
                for (int i = currentTimerTexts; i < numCntrs; i++)
                {
                    DISPLAY.createRow(names[i]);
                }
            }

            //set actual time array values for timers
            for (int i = 0; i < StaticUtility.maximumRows; i++)
            {
                if (counters[i] == "")
                {
                    activeTimeArray[i] = new TimeSpan(0, 0, 0);
                    continue;
                }
                activeTimeArray[i] = StaticUtility.stringToTimeSpan(counters[i]);
            }

            //update the text boxes
            for (int i = 0; i < numCntrs; i++)
            {
                DISPLAY.setTimerTextBox(i, names[i]);
                DISPLAY.disUpd1Row(i, activeTimeArray[i]);
            }

            //update the total and stopped value
            DISPLAY.disUpdTotal(engCalcArrayTotal());
            stopElapsed = StaticUtility.stringToTimeSpan(stoppedTotal);
            FILEMECH.writeRow(DateTime.Now, DateTime.Now, new TimeSpan(0, 0, 0), "[LOAD]", -2, stopElapsed);
        }
예제 #2
0
 /// <summary>
 /// Called from Config window. Saves the column settings.
 /// </summary>
 public void saveConfigColumns()
 {
     Properties.Settings.Default.NameList = string.Join(",", DISPLAY.returnTextBoxList());
     Properties.Settings.Default.Save();
 }