コード例 #1
0
        private void Start_Scheduling_Button_Click(object sender, EventArgs e)
        {
            int hour   = 0;
            int minute = 0;

            #region
            if (Scheduling_Hour_TextBox.Text == "Hour")
            {
                my_player.Schedule_Recording_toolTip.Show("Please Set at What Time You Want Recording to Happen", Scheduling_Hour_TextBox);
                my_player.Schedule_Recording_toolTip.Show("Please Set at What Time You Want Recording to Happen", Scheduling_Hour_TextBox);
            }
            else
            {
                hour = Int32.Parse(Scheduling_Hour_TextBox.Text);
            }

            if (Scheduling_Minute_TextBox.Text == "Min")
            {
                my_player.Schedule_Recording_toolTip.Show("Please Set at What Time You Want Recording to Happen", Scheduling_Minute_TextBox);
                my_player.Schedule_Recording_toolTip.Show("Please Set at What Time You Want Recording to Happen", Scheduling_Minute_TextBox);
            }
            else
            {
                minute = Int32.Parse(Scheduling_Minute_TextBox.Text);
            }

            if (Time_of_Day_comboBox.Text == "AM")
            {
                scheduled_time = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hour, minute, 0);
            }
            if (Time_of_Day_comboBox.Text == "PM")
            {
                scheduled_time = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hour + 12, minute, 0);
            }
            #endregion
            if (Scheduling_Hour_TextBox.Text != "Hour" && Scheduling_Minute_TextBox.Text != "Min")
            {
                Schedule_Recording_timer.Start();

                Is_Scheduling_CheckBox.Checked = true;

                #region Disable Unneccesary Controls
                Scheduling_Hour_TextBox.Enabled     = false;
                Scheduling_Minute_TextBox.Enabled   = false;
                Time_of_Day_comboBox.Enabled        = false;
                Start_Scheduling_Button.Enabled     = false;
                Stop_Scheduling_Button.Enabled      = true;
                Schedule_Recording_checkBox.Enabled = true;
                #endregion
            }
        }
コード例 #2
0
        private void Start_Scheduling_Button_Click(object sender, EventArgs e)
        {
            int hour   = 0;
            int minute = 0;

            #region
            #region
            if (scheduled_date == null)
            {
                my_player.Schedule_Recording_toolTip.Show("Please Set at What Time You Want Recording to Happen", Select_Day_Button);
                my_player.Schedule_Recording_toolTip.Show("Please Set at What Time You Want Recording to Happen", Select_Day_Button);
            }
            if (scheduled_date.Date.Day < DateTime.Now.Day)
            {
                my_player.Schedule_Recording_toolTip.Show("Please Choose Another Date", Select_Day_Button);
                my_player.Schedule_Recording_toolTip.Show("Please Choose Another Date", Select_Day_Button);
            }
            if (Scheduling_Hour_textbox1.Text == "Hour")
            {
                my_player.Schedule_Recording_toolTip.Show("Please Set at What Time You Want Recording to Happen", Scheduling_Hour_textbox1);
                my_player.Schedule_Recording_toolTip.Show("Please Set at What Time You Want Recording to Happen", Scheduling_Hour_textbox1);
            }
            else
            {
                hour = Int32.Parse(Scheduling_Hour_textbox1.Text);
            }

            if (Scheduling_Minute_textBox1.Text == "Min")
            {
                my_player.Schedule_Recording_toolTip.Show("Please Set at What Time You Want Recording to Happen", Scheduling_Minute_textBox1);
                my_player.Schedule_Recording_toolTip.Show("Please Set at What Time You Want Recording to Happen", Scheduling_Minute_textBox1);
            }
            else
            {
                minute = Int32.Parse(Scheduling_Minute_textBox1.Text);
            }
            #endregion
            #region
            if (Time_of_Day_comboBox1.Text == "AM")
            {
                if (hour == 12)
                {
                    scheduled_time = new DateTime(scheduled_date.Year, scheduled_date.Month, scheduled_date.Day, 0, minute, 0);
                }
                else
                {
                    scheduled_time = new DateTime(scheduled_date.Year, scheduled_date.Month, scheduled_date.Day, hour, minute, 0);
                }
            }
            if (Time_of_Day_comboBox1.Text == "PM")
            {
                if ((hour + 12) < 24)
                {
                    scheduled_time = new DateTime(scheduled_date.Year, scheduled_date.Month, scheduled_date.Day, hour + 12, minute, 0);
                }

                if ((hour + 12) == 24)
                {
                    scheduled_time = new DateTime(scheduled_date.Year, scheduled_date.Month, scheduled_date.Day, hour, minute, 0);
                }
            }
            #endregion
            #endregion

            if (Scheduling_Hour_textbox1.Text != "Hour" && Scheduling_Minute_textBox1.Text != "Min" && scheduled_date != null && !(scheduled_date.Date.Day < DateTime.Now.Day))
            {
                Schedule_Recording_timer.Start();

                has_recorded = false;
                Is_Scheduling_CheckBox.Checked = true;
                my_player.isScheduling         = true;

                #region Disable Unneccesary Controls
                Set_When_groupBox.Enabled       = false;
                Set_How_Long_groupBox1.Enabled  = false;
                Set_Name_groupBox1.Enabled      = false;
                Start_Scheduling_Button.Enabled = false;
                Select_Name_button.Enabled      = false;
                Stop_Scheduling_Button.Enabled  = true;
                #endregion

                Set_When_groupBox.ForeColor                 = Color.Red;
                Set_How_Long_groupBox1.ForeColor            = Color.Blue;
                Start_Schedule_Recording_GroupBox.ForeColor = Color.Blue;
            }
        }