Exemple #1
0
 private void SystemEvents_UserPreferenceChanging(object sender, UserPreferenceChangingEventArgs e)
 {
     Graphix.UpdatePanelColor(panel8, Graphix.GetAccentColor());
     foreach (Control item in panel6.Controls)
     {
         if (item is Panel)
         {
             Panel p = (Panel)item;
             Graphix.UpdateColor(p, Graphix.GetAccentColor());
         }
     }
 }
Exemple #2
0
        private void Disable(Graphix c)
        {
            foreach (Graphix item in gg)
            {
                if (item != c)
                {
                    item.state = false;
                }
            }

            c.state = !c.state;

            if (c.state)
            {
                foreach (Button item in Buttons)
                {
                    item.Enabled = false;
                }
                for (int j = 0; j < c.Buttons.Count; j++)
                {
                    int k = c.Buttons[j].Location.Y / Graphix.Height;
                    int l = c.Buttons[j].Height / Graphix.Height;

                    for (int i = k; i < k + l + 1; i++)
                    {
                        Buttons[i].Enabled = true;
                    }
                }
            }
            else
            {
                foreach (Button item in Buttons)
                {
                    item.Enabled = true;
                }
            }
        }
Exemple #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //CourseManager.UpdateCache();

            // OLD
            //Course.Deserialize();
            //foreach (CourseXml item in Course.CoursesXml)
            //{
            //    CourseManager.AddCourse(CourseManager.GetCourseByCRN(item.Code, item.CRN));
            //}

            if (!File.Exists("AllProfiles.xml"))
            {
                Updater u = new Updater();
                u.ShowDialog();
            }
            CourseManager.Deserialize();
            string[] crn_list = Course.LoadCRNList();
            foreach (var item in crn_list)
            {
                Console.WriteLine(item);
            }
            foreach (var item in crn_list)
            {
                var c = CourseManager.GetCourseByCRNLocal(item);
                Console.Write("Adding Course: ");
                Console.WriteLine(c);
                CourseManager.AddCourse(c);
            }

            SystemEvents.UserPreferenceChanging += SystemEvents_UserPreferenceChanging;
            d  = new Graphix(panel1, Days.Monday);
            d1 = new Graphix(panel2, Days.Tuesday);
            d2 = new Graphix(panel3, Days.Wednesday);
            d3 = new Graphix(panel4, Days.Thursday);
            d4 = new Graphix(panel5, Days.Friday);

            for (int i = 0; i < 17; i++)
            {
                Buttons[i] = new Button();
                buttonsP.Controls.Add(Buttons[i]);
                Buttons[i].Size     = new Size(buttonsP.Width, Graphix.Height);
                Buttons[i].Location = new Point(0, (Graphix.Height) * i);
                Buttons[i].FlatAppearance.BorderSize  = 0;
                Buttons[i].FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0);
                Buttons[i].FlatStyle = FlatStyle.Flat;
                string AfterText = (8 + (i + 2) / 2).ToString() + ":" + (30 * ((i + 2) % 2)).ToString();
                Buttons[i].Text = (8 + (i + 1) / 2).ToString() + ":" + (30 * ((i + 1) % 2)).ToString() + "-" + AfterText;
            }
            panel6.BackColor = Color.FromArgb(255, 30, 30, 30);
            Graphix.UpdatePanelColor(panel8, Graphix.GetAccentColor());
            foreach (Control item in panel6.Controls)
            {
                if (item is Panel)
                {
                    Panel p = (Panel)item;
                    Graphix.UpdateColor(p, Graphix.GetAccentColor());
                }
            }
            this.Size = panel8.Size;

            foreach (Button item in panel7.Controls)
            {
                item.Click += Item_Click;
            }
            gg[0] = d;
            gg[1] = d1;
            gg[2] = d2;
            gg[3] = d3;
            gg[4] = d4;
            List <Panel> lop = GetPanels(this);

            foreach (Panel item in lop)
            {
                item.MouseDown += Item_MouseDown;
            }
        }