public void Bind(DataGridView dgv, BindingSource bds, Drawings drawings = null) { bds.DataSource = drawings ?? Drawings; //if (drawings != null) // HiddenColumns.Add(SpecialPlayIndex); dgv.DataSource = bds; foreach (DataGridViewColumn column in dgv.Columns) { ColumnSpec cs = ColumnSpecs.GetColumSpec(column.Name); column.HeaderText = cs.Header; column.HeaderCell.Style.Alignment = cs.Header == ColumnHeader.Date.ToString() ? DataGridViewContentAlignment.MiddleLeft : DataGridViewContentAlignment.MiddleCenter; column.DefaultCellStyle.Alignment = cs.Header == Constants.NUMBER_HEADER ? DataGridViewContentAlignment.MiddleCenter : DataGridViewContentAlignment.MiddleLeft; } foreach (DataGridViewColumn dgvColumn in dgv.Columns) { dgvColumn.Visible = true; } HiddenColumns.ForEach(hc => dgv.Columns[hc].Visible = false); }
protected Lottery(string appPath) { FilePath = Path.Combine(appPath, FileName); Headers = new Dictionary <string, string>(); AllowRepeatedNums = false; Error = string.Empty; NumbersIndexes = new HashSet <int>(); Drawings = new Drawings(); NumberMax = DefaultNumber; SpecialNumberMax = DefaultNumber; SpecialNumberIndex = DefaultNumber; SpecialPlayIndex = DefaultNumber; ColumnSpecs = new ColumnSpecs(); HiddenColumns = new List <int>(); }
public PowerBall(string appPath) : base(appPath) { Name = EnumLotteries.Powerball.ToString(); FilePath = Path.Combine(appPath, FileName); ColumnSpecs.OverrideColumnName(ColumnHeader.SpecialNumber, "Power Ball"); ColumnSpecs.OverrideColumnName(ColumnHeader.SpecialPlay, "Power Play"); Url = "https://txlottery.org/export/sites/lottery/Games/Powerball/Winning_Numbers/powerball.csv"; powerballPattern = new PatternSection[] { PatternSection.str, PatternSection.month, PatternSection.day, PatternSection.year, PatternSection.number, PatternSection.number, PatternSection.number, PatternSection.number, PatternSection.number, PatternSection.specialnumber, PatternSection.plays }; UpdateIndexes(powerballPattern); NumberMax = numberMax; SpecialNumberMax = specialNumberMax; SpecialPlayIndex = 10; HistoricNumMax = historicNumMax; HistoricSpecialNumMax = historicSpecialNumMax; }
public CashForLife(string appPath) : base(appPath) { Name = EnumLotteries.Cash4Life.ToString(); FilePath = Path.Combine(appPath, FileName); ColumnSpecs.OverrideColumnName(ColumnHeader.SpecialNumber, "Cash Ball"); Url = "http://www.flalottery.com/exptkt/c4l.htm"; cash4LifePattern = new PatternSection[] { PatternSection.str, PatternSection.month, PatternSection.day, PatternSection.year, PatternSection.number, PatternSection.number, PatternSection.number, PatternSection.number, PatternSection.number, PatternSection.specialnumber }; UpdateIndexes(cash4LifePattern); NumberMax = numberMax; SpecialNumberMax = specialNumberMax; SpecialPlayIndex = 7; HistoricNumMax = historicNumMax; HistoricSpecialNumMax = historicSpecialNumMax; HiddenColumns = new List <int>() { SpecialPlayIndex }; }