Example #1
0
        // Subroutines

        private void SubPreloadStuff()
        {
            // Gets current date from PC
            vDisplayDate = DateTime.Now.ToString("dd/MM/yy");

            // Gets current tine from PC
            vDisplayTime = DateTime.Now.ToString("HH:mm:ss");

            // Gets current day of the week
            vDisplayDay = DateTime.Now.DayOfWeek.ToString();

            // Displays the current time
            BtnShowTime.Text = vDisplayTime;

            // Displays current day of the week
            lblDay.Text = vDisplayDay;

            // Display the current date
            BtnShowDate.Text = vDisplayDate;

            // Enables Timer
            TmrClockTick.Enabled = true;

            // Starts Timer
            TmrClockTick.Start();
        }
Example #2
0
        // Subroutines

        private void SubPreloadStuff()
        {
            // Hourly reports
            alHourlyReport.Add("00:00:00");
            alHourlyReport.Add("01:00:00");
            alHourlyReport.Add("02:00:00");
            alHourlyReport.Add("03:00:00");
            alHourlyReport.Add("04:00:00");
            alHourlyReport.Add("05:00:00");
            alHourlyReport.Add("06:00:00");
            alHourlyReport.Add("07:00:00");
            alHourlyReport.Add("08:00:00");
            alHourlyReport.Add("09:00:00");
            alHourlyReport.Add("10:00:00");
            alHourlyReport.Add("11:00:00");
            alHourlyReport.Add("12:00:00");
            alHourlyReport.Add("13:00:00");
            alHourlyReport.Add("14:00:00");
            alHourlyReport.Add("15:00:00");
            alHourlyReport.Add("16:00:00");
            alHourlyReport.Add("17:00:00");
            alHourlyReport.Add("18:00:00");
            alHourlyReport.Add("19:00:00");
            alHourlyReport.Add("20:00:00");
            alHourlyReport.Add("21:00:00");
            alHourlyReport.Add("22:00:00");
            alHourlyReport.Add("23:00:00");

            // Checks for directory and reminders
            // if neither can be found, they will be
            // created automatically.

            if (!Directory.Exists(vSysDir))
            {
                Directory.CreateDirectory(vSysDir);
            }

            if (Directory.Exists(vSysDir))
            {
                if (!File.Exists(vSysDir + "Monday" + vFileEx))
                {
                    File.Create(vSysDir + "Monday" + vFileEx);
                }
                else
                {
                    lblDay.Text = "Monday";
                    if (lblDay.Text == DateTime.Now.DayOfWeek.ToString())
                    {
                        // Runs subroutines
                        SubOpenDayOfReminder();
                    }
                }

                if (!File.Exists(vSysDir + "Tuesday" + vFileEx))
                {
                    File.Create(vSysDir + "Tuesday" + vFileEx);
                }
                else
                {
                    lblDay.Text = "Tuesday";
                    if (lblDay.Text == DateTime.Now.DayOfWeek.ToString())
                    {
                        // Runs subroutines
                        SubOpenDayOfReminder();
                    }
                }

                if (!File.Exists(vSysDir + "Wednesday" + vFileEx))
                {
                    File.Create(vSysDir + "Wednesday" + vFileEx);
                }
                else
                {
                    lblDay.Text = "Wednesday";
                    if (lblDay.Text == DateTime.Now.DayOfWeek.ToString())
                    {
                        // Runs subroutines
                        SubOpenDayOfReminder();
                    }
                }

                if (!File.Exists(vSysDir + "Thursday" + vFileEx))
                {
                    File.Create(vSysDir + "Thursday" + vFileEx);
                }
                else
                {
                    lblDay.Text = "Thursday";
                    if (lblDay.Text == DateTime.Now.DayOfWeek.ToString())
                    {
                        // Runs subroutines
                        SubOpenDayOfReminder();
                    }
                }

                if (!File.Exists(vSysDir + "Friday" + vFileEx))
                {
                    File.Create(vSysDir + "Friday" + vFileEx);
                }
                else
                {
                    lblDay.Text = "Friday";
                    if (lblDay.Text == DateTime.Now.DayOfWeek.ToString())
                    {
                        // Runs subroutines
                        SubOpenDayOfReminder();
                    }
                }

                if (!File.Exists(vSysDir + "Saturday" + vFileEx))
                {
                    File.Create(vSysDir + "Saturday" + vFileEx);
                }
                else
                {
                    lblDay.Text = "Saturday";
                    if (lblDay.Text == DateTime.Now.DayOfWeek.ToString())
                    {
                        // Runs subroutines
                        SubOpenDayOfReminder();
                    }
                }

                if (!File.Exists(vSysDir + "Sunday" + vFileEx))
                {
                    File.Create(vSysDir + "Sunday" + vFileEx);
                }
                else
                {
                    lblDay.Text = "Sunday";
                    if (lblDay.Text == DateTime.Now.DayOfWeek.ToString())
                    {
                        // Runs subroutine
                        SubOpenDayOfReminder();
                    }
                }
            }

            // Gets current date from PC
            vDisplayDate = DateTime.Now.ToString("dd/MM/yy");

            // Gets current tine from PC
            vDisplayTime = DateTime.Now.ToString("HH:mm:ss");

            // Gets current day of the week
            vDisplayDay = DateTime.Now.DayOfWeek.ToString();

            // Displays the current time
            BtnShowTime.Text = vDisplayTime;

            // Displays current day of the week
            lblDay.Text = vDisplayDay;

            // Display the current date
            BtnShowDate.Text = vDisplayDate;

            // Enables Timer
            TmrClockTick.Enabled = true;

            // Default selected voice "David"
            Synth.SelectVoice("Microsoft David Desktop");
            frmlblVoice.Text = "David";

            // Volume preset at 50%
            Synth.Volume   = 50;
            lblVolume.Text = Synth.Volume.ToString() + "%";

            // Disables buttons
            BtnDelteReminder.Enabled        = false;
            BtnAddReminder.Enabled          = false;
            BtnClearReminderWritten.Enabled = false;
            BtnViewedReminder.Enabled       = false;
            lblDisplayReminders.Visible     = false;

            // Updates reminders
            SubUpdateReminders();

            // Gives focus to text entry field
            RBxReminder.Focus();

            // Starts Timer
            TmrClockTick.Start();
        }