Exemplo n.º 1
0
 private void Expanded_Activated(object sender, EventArgs e)
 {
     if (Program.TimetableList.Count == 0)
     {
         MissingLabel.BringToFront();
         MissingLabel.Show();
     }
     else
     {
         MissingLabel.Hide();
     }
 }
Exemplo n.º 2
0
        private void Expanded_Activated(object sender, EventArgs e)
        {
            if (Program.TimetableList.Count == 0)
            {
                MissingLabel.BringToFront();
                MissingLabel.Show();
            }
            else
            {
                MissingLabel.Hide();
            }
            if (!started)
            {
                Termlabel.Text = "Term " + Program.SettingsData.Curterm;
                started        = true;
                for (int k = 0; k < 10; k++)
                {
                    for (int i = 0; i <= 6; i++)
                    {
                        period tPeriod;
                        if (Program.TimetableList.ContainsKey((k + 1) + "" + i))
                        {
                            tPeriod = Program.TimetableList[(k + 1) + "" + i];
                        }
                        else
                        {
                            tPeriod              = new period();
                            tPeriod.ClassCode    = "";
                            tPeriod.DayNumber    = -1;
                            tPeriod.PeriodNumber = -1;
                        }
                        TextBox textLabel = new TextBox();
                        Label   classroom = new Label();
                        Label   classcod  = new Label();
                        classroom.Text        = tPeriod.Room;
                        classroom.Location    = new Point(65, 65);
                        classcod.Text         = tPeriod.ClassCode;
                        classcod.Location     = new Point(0, 65);
                        classcod.AutoSize     = true;
                        textLabel.ReadOnly    = true;
                        textLabel.WordWrap    = true;
                        textLabel.BorderStyle = BorderStyle.None;
                        textLabel.Width       = 98;
                        textLabel.Height      = 45;
                        textLabel.Multiline   = true;
                        textLabel.Location    = new Point(1, 3);
                        Panel eriod = (Panel)(Controls.Find((k + 1) + i.ToString(), false))[0];
                        textLabel.Text      = tPeriod.ClassDescription;
                        eriod.BackColor     = Program.ColorRef.ContainsKey(tPeriod.ClassCode) ? Program.ColorRef[tPeriod.ClassCode] : Color.White;
                        textLabel.BackColor = eriod.BackColor;
                        eriod.Controls.Clear();
                        eriod.Controls.Add(classcod);
                        eriod.Controls.Add(classroom);
                        eriod.Controls.Add(textLabel);
                    }
                }
            }

            if (Program.curDay == 0)
            {
                Curdayhigh.Visible = false;
            }
            else
            {
                Panel deriod = (Panel)(Controls.Find(Program.curDay + "0", false))[0];
                Curdayhigh.Visible  = true;
                Curdayhigh.Location = new Point(deriod.Location.X - 10, 0);
            }
            if (Program.SettingsData.EarlyDate.Date == DateTime.Now.Date)
            {
                Earlybutt.BackColor = Color.GreenYellow;
            }
        }