예제 #1
0
        //-------------------------------------------------------Form Events----------------------------------------------------------
        //things like on load or pressing a button

        //on opening the form check if initialized is true or false, if false open website checkboxes and hide this
        private void MainTimer_Load(object sender, EventArgs e)
        {
            if (!Properties.Settings.Default.initialized)//first time set up
            {
                Gather_Time_Data gather_Time_Data = new Gather_Time_Data();
                gather_Time_Data.Show();//show the GTD form

                //the main form is hidden in a shown event because load happens before shown

                //if this is the first time adding a value to the string collection
                //we need to make it empty rather than null
                if (Properties.Settings.Default.leisure_last_seven_days == null)
                {
                    System.Collections.Specialized.StringCollection stringCollection = new System.Collections.Specialized.StringCollection();
                    Properties.Settings.Default.leisure_last_seven_days = stringCollection;
                }

                if (Properties.Settings.Default.productivity_last_seven_days == null)
                {
                    System.Collections.Specialized.StringCollection stringCollection = new System.Collections.Specialized.StringCollection();
                    Properties.Settings.Default.productivity_last_seven_days = stringCollection;
                }
            }
            else
            {
                //check if it is a new day or not and if it is call a daily reset
                if (new_Day())
                {
                    daily_Reset();
                }

                //this function initializes the timer values on the MainTimer form
                initialize_timer_values();
            }
        }
예제 #2
0
        //--------------------------------------------------Create Form Functions----------------------------------------------------
        //These functions all create different forms in the intialization process. They are used so that each form can
        //create the next form in the list, but I need the main form (MainTimer) to be the on to do so
        //because it needs to be unhidden at the end of the initalization process
        public void create_gather_time_data()
        {
            Gather_Time_Data gather_Time_Data = new Gather_Time_Data();

            gather_Time_Data.Show();//show the GTD form
        }