protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == Keys.Escape) { this.btnCancel.PerformClick(); return true; } if (keyData == Keys.Enter) { this.btnOK.PerformClick(); return true; } if (keyData == Keys.Tab) { Dealer current_item = (Dealer)this.dgvDealer.Rows[this.dgvDealer.CurrentCell.RowIndex].Tag; if (this.sort_mode == SORT_MODE.DEALER) { this.sort_mode = SORT_MODE.COMPNAM; this.dgvDealer.Columns[1].HeaderCell.Style.BackColor = ColorResource.COLUMN_HEADER_NOT_SORTABLE_GREEN; this.dgvDealer.Columns[2].HeaderCell.Style.BackColor = Color.OliveDrab; } else { this.sort_mode = SORT_MODE.DEALER; this.dgvDealer.Columns[1].HeaderCell.Style.BackColor = Color.OliveDrab; this.dgvDealer.Columns[2].HeaderCell.Style.BackColor = ColorResource.COLUMN_HEADER_NOT_SORTABLE_GREEN; } this.FillInDatagrid(); this.SetSelectedItem(current_item); return true; } return base.ProcessCmdKey(ref msg, keyData); }
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == Keys.Escape) { this.btnCancel.PerformClick(); return(true); } if (keyData == Keys.Enter) { this.btnOK.PerformClick(); return(true); } if (keyData == Keys.Tab) { Dealer current_item = (Dealer)this.dgvDealer.Rows[this.dgvDealer.CurrentCell.RowIndex].Tag; if (this.sort_mode == SORT_MODE.DEALER) { this.sort_mode = SORT_MODE.COMPNAM; this.dgvDealer.Columns[1].HeaderCell.Style.BackColor = ColorResource.COLUMN_HEADER_NOT_SORTABLE_GREEN; this.dgvDealer.Columns[2].HeaderCell.Style.BackColor = Color.OliveDrab; } else { this.sort_mode = SORT_MODE.DEALER; this.dgvDealer.Columns[1].HeaderCell.Style.BackColor = Color.OliveDrab; this.dgvDealer.Columns[2].HeaderCell.Style.BackColor = ColorResource.COLUMN_HEADER_NOT_SORTABLE_GREEN; } this.FillInDatagrid(); this.SetSelectedItem(current_item); return(true); } return(base.ProcessCmdKey(ref msg, keyData)); }
public DealerWindow(MainForm main_form) { Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("th-TH"); InitializeComponent(); this.main_form = main_form; this.G = main_form.G; this.sort_mode = SORT_MODE.DEALER; }
public void NextMode() { mode++; if ((int)mode > 2) { mode = SORT_MODE.STATISTIC; } HallOfFame.Instance().Sort(); }
public HallOfFameSorter(GameScenes scene, DIRECTION direction = DIRECTION.ASCENDING, SORT_MODE mode = SORT_MODE.STATISTIC, STATS_SORTING stats_sort = STATS_SORTING.NAME, SKILL_SORTING skill_sort = SKILL_SORTING.SPECIALIST) : base(scene) { this.direction = direction; this.mode = mode; this.stats_sorting = stats_sort; this.skill_sorting = skill_sort; }
public DealerList(SnWindow parent_window, string dealer_code) : this() { this.parent_window = parent_window; this.selected_dealer_code = dealer_code; this.sort_mode = SORT_MODE.DEALER; this.FillInDatagrid(); this.SetSelectedItem(); }
private void dgvDealer_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { foreach (DataGridViewColumn col in ((DataGridView)sender).Columns) { col.HeaderCell.Style.BackColor = ColorResource.COLUMN_HEADER_NOT_SORTABLE_GREEN; } ((DataGridView)sender).Columns[e.ColumnIndex].HeaderCell.Style.BackColor = Color.OliveDrab; Dealer current_item = (Dealer)this.dgvDealer.Rows[this.dgvDealer.CurrentCell.RowIndex].Tag; if (e.ColumnIndex == 1 && this.sort_mode == SORT_MODE.COMPNAM) { this.sort_mode = SORT_MODE.DEALER; this.FillInDatagrid(); this.SetSelectedItem(current_item); } else if (e.ColumnIndex == 2 && this.sort_mode == SORT_MODE.DEALER) { this.sort_mode = SORT_MODE.COMPNAM; this.FillInDatagrid(); this.SetSelectedItem(current_item); } }
public void SetMode(SORT_MODE mode) { this.mode = mode; HallOfFame.Instance().Sort(); }
private void toolStripSearchName_Click(object sender, EventArgs e) { SearchDealerBox wind = new SearchDealerBox(SearchDealerBox.SEARCH_TYPE.NAME); wind.txtKeyWord.Text = this.find_name; if (wind.ShowDialog() == DialogResult.OK) { this.sort_mode = SORT_MODE.COMPNAM; this.GetDealerIdList(); this.find_name = wind.txtKeyWord.Text; this.FormProcessing(); int target_id = this.dealer.id; // default to current id bool is_founded = false; // default search result to false BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += delegate { if (this.find_name.Length > 0) { foreach (Dealer d in this.dealer_id_list) { if (d.compnam != null) { if (string.CompareOrdinal(d.compnam, this.find_name) >= 0) { target_id = d.id; is_founded = true; break; } } } } else { is_founded = true; } }; worker.RunWorkerCompleted += delegate { if (is_founded) { if (target_id != this.dealer.id) { this.GetDealerByID(target_id); this.FillForm(); } this.FormRead(); } else { this.FormRead(); MessageAlert.Show(StringResource.DATA_NOT_FOUND, "", MessageAlertButtons.OK, MessageAlertIcons.NONE); } }; worker.RunWorkerAsync(); } }