예제 #1
0
        public void addDisciplineItem(Discipline newDiscipline)
        {
            DisciplineItem tmp = new DisciplineItem(newDiscipline);

            tmp.MouseUp += new MouseEventHandler(Discipline_Click);
            this.disciplinesPanel.Controls.Add(tmp);
        }
예제 #2
0
        private void getData()
        {
            var repository  = new DisciplineRepository(); //po odkomentowaniu nastepnej linijki sie wysypuje
            var disciplines = repository.GetAll();

            foreach (Discipline discipline in disciplines)
            {
                DisciplineItem tmp = new DisciplineItem(discipline);
                tmp.MouseUp += new MouseEventHandler(Discipline_Click);
                this.disciplinesPanel.Controls.Add(tmp);
            }
        }
예제 #3
0
        void Discipline_Click(Object sender, EventArgs e)
        {
            item = (DisciplineItem)sender;
            handle = item.getDiscipline();

            MouseEventArgs me = (MouseEventArgs)e;
            if (me.Button == System.Windows.Forms.MouseButtons.Left)
            {
                var view = new DisciplineElements(handle);
                view.Show();
            }
            if (me.Button == System.Windows.Forms.MouseButtons.Right)
            {
                metroContextMenu1.Show(System.Windows.Forms.Cursor.Position);
            }
        }
예제 #4
0
        void Discipline_Click(Object sender, EventArgs e)
        {
            item   = (DisciplineItem)sender;
            handle = item.getDiscipline();

            MouseEventArgs me = (MouseEventArgs)e;

            if (me.Button == System.Windows.Forms.MouseButtons.Left)
            {
                var view = new DisciplineElements(handle);
                view.Show();
            }
            if (me.Button == System.Windows.Forms.MouseButtons.Right)
            {
                metroContextMenu1.Show(System.Windows.Forms.Cursor.Position);
            }
        }
예제 #5
0
 private void getData()
 {
     var repository = new DisciplineRepository(); //po odkomentowaniu nastepnej linijki sie wysypuje
     var disciplines = repository.GetAll();
     foreach (Discipline discipline in disciplines)
     {
         DisciplineItem tmp = new DisciplineItem(discipline);
         tmp.MouseUp += new MouseEventHandler(Discipline_Click);
         this.disciplinesPanel.Controls.Add(tmp);
     }
 }
예제 #6
0
 public void addDisciplineItem(Discipline newDiscipline)
 {
     DisciplineItem tmp = new DisciplineItem(newDiscipline);
     tmp.MouseUp += new MouseEventHandler(Discipline_Click);
     this.disciplinesPanel.Controls.Add(tmp);
 }