private void listViewDivers_ItemChecked(object sender, ItemCheckedEventArgs e) { CheckIfSubmitButtonBeEnable(); NewEventPresenter.AddDataGridViewToTabControl(tabControl1, listViewDivers, _diveNo, _diveName, _dataGridViewList, DiveCount_numericUpDown, panel1); PanelDrawer.Colorize(this); //lägger till en eventhandler till varje DataGridView for (int i = 0; i < _dataGridViewList.Count; i++) { _dataGridViewList[i].EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(DiveTypeInput_dataGridView_EditingControlShowing); _dataGridViewList[i].CellEndEdit += new DataGridViewCellEventHandler(DataGridViewDives_CellEndEdit); _dataGridViewList[i].CellBeginEdit += new DataGridViewCellCancelEventHandler(DataGridViewDives_CellBeginEdit); } }
public FormMain(MainPresenter presenter = null) { _presenter = presenter; if (_presenter == null) { _presenter = new MainPresenter(this); } InitializeComponent(); SearchItemSource = new Dictionary <ListViewItem, bool>(); PanelDrawer.Colorize(this); _presenter.FillListViewWithEvent(); }
public FormNewEvent() { InitializeComponent(); PanelDrawer.Colorize(this); //fyller listorna med dommare och hoppare NewEventPresenter.FillListViewWithDivers(radioButtonMale, radioButtonFemale, listViewDivers); NewEventPresenter.FillListViewWithJudges(listViewJudge); listViewDivers.ItemDrag += listViewDivers_ItemDrag; listViewDivers.DragEnter += listViewDivers_DragEnter; listViewDivers.DragDrop += listViewDivers_DragDrop; listViewDivers.AllowDrop = true; //hämtar autocomplete listorna från databasen Database.GetAutoCompleteListsFromDatabase(_diveNo, _diveName); Database.GetAutoCompleteListsFromDatabase(_diveNoReadOnly, _diveNameReadOnly); }
/// <summary> /// Målar upp tabs och hopp-rutor för alla dykare i eventet /// </summary> private void DrawPanels() { //Applicera färgtema PanelDrawer.Colorize(this); //Skapa poäng-panelen _panelScoring = PanelDrawer.ScoringPanel(panelControls, new EventHandler(btnScoreClick)); panelControls.Controls.Add(_panelScoring); //Måla upp alla hopp och skapa tabs for (int i = 0; i < CurrentDiver.Dives.Count; i++) //Rundor { tabsRounds.TabPages.Add("Runda " + (i + 1)); _divePanels.Add(new List <Panel>()); /* Formattera */ Panel page = new Panel(); page.Width = pagePanelContainer.Width - 5; page.Height = pagePanelContainer.Height; page.Top = page.Left = 3; page.Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom; page.AutoScroll = true; /* Lägg till i form och i lista */ pagePanelContainer.Controls.Add(page); _pagePanels.Add(page); for (int j = 0; j < Divers.Count(); j++) //Hoppare { Panel p = PanelDrawer.DivePanel(Divers[j], i, Judges.Count, UpdateScore); _divePanels[i].Add(p); p.Top = (p.Height + 2) * j; _pagePanels[i].Controls.Add(p); } } //Populera tävlande och domare RedrawContestInfo(); }
private void DiveCount_numericUpDown_ValueChanged(object sender, EventArgs e) { NewEventPresenter.AddDataGridViewToTabControl(tabControl1, listViewDivers, _diveNo, _diveName, _dataGridViewList, DiveCount_numericUpDown, panel1); PanelDrawer.Colorize(this); }
//autocomplete private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { NewEventPresenter.AddAutoCompleteToDataGridView(_dataGridViewList, tabControl1, e, _diveNo, _diveNoReadOnly, _diveName, _diveNameReadOnly, groupBoxDisciplin); PanelDrawer.Colorize(this); }