コード例 #1
0
        public static int init_num(BindingList <NumberAll> listNum, BindingList <LottoryItem> listHis)
        {
            int[] map = new int[50];
            for (int i = 0; i < 50; i++)
            {
                map[i] = 0;
            }


            listNum.Clear();
            foreach (LottoryItem item in listHis)
            {
                for (int i = 0; i < 50; i++)
                {
                    map[i]++;
                }

                NumberAll number = new NumberAll();
                number.number[0] = item.id;
                for (int i = 0; i < 49; i++)
                {
                    number.number[i + 1] = map[i];
                }

                for (int i = 0; i < 6; i++)
                {
                    number.number[item.red[i]]  = item.red[i];
                    number.map[item.red[i] - 1] = 1;
                    map[item.red[i] - 1]        = 0;
                }
                if (item.blue == 13)
                {
                    item.blue = 13;
                }

                number.number[33 + item.blue]  = item.blue;
                number.map[33 + item.blue - 1] = 1;
                map[33 + item.blue - 1]        = 0;
                listNum.Add(number);
            }

            return(listNum.Count);
        }
コード例 #2
0
        private void bandedGridViewDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
        {
            if (e.Column.ColumnHandle > 0 && gridListAll.Count > 0)
            {
                NumberAll number = (NumberAll)gridListAll[e.RowHandle];

                if (number.map[e.Column.ColumnHandle - 1] > 0)
                {
                    if (e.Column.AbsoluteIndex > 33)
                    {
                        e.Appearance.BackColor = Color.LightBlue;
                        //e.Appearance.BackColor = Color.DeepSkyBlue;
                    }
                    else
                    {
                        //e.Appearance.BackColor = Color.Moccasin;
                        e.Appearance.BackColor = Color.PeachPuff;
                    }
                    e.Appearance.ForeColor = Color.DarkBlue;
                }
            }
        }