示例#1
0
        private void update_dice_rolls()
        {
            this.DiceList.Items.Clear();
            this.DiceList.LargeImageList = new ImageList()
            {
                ImageSize = new System.Drawing.Size(32, 32)
            };
            List <int> nums = new List <int>();

            foreach (Pair <int, int> pair in this.fDice)
            {
                ListViewItem count = this.DiceList.Items.Add("");
                count.Tag = pair;
                ImageList.ImageCollection images = this.DiceList.LargeImageList.Images;
                int first  = pair.First;
                int second = pair.Second;
                images.Add(this.get_image(first, second.ToString()));
                count.ImageIndex = this.DiceList.LargeImageList.Images.Count - 1;
                nums.Add(pair.First);
            }
            if (!this.fUpdating)
            {
                this.fUpdating          = true;
                this.ExpressionBox.Text = (this.fDice.Count != 0 ? DiceStatistics.Expression(nums, this.fConstant) : "");
                this.fUpdating          = false;
            }
        }
示例#2
0
        void update_dice_rolls()
        {
            DiceList.Items.Clear();

            DiceList.LargeImageList           = new ImageList();
            DiceList.LargeImageList.ImageSize = new System.Drawing.Size(DIE_SIZE, DIE_SIZE);

            List <int> sides = new List <int>();

            foreach (Pair <int, int> die in fDice)
            {
                ListViewItem lvi = DiceList.Items.Add("");
                lvi.Tag = die;

                DiceList.LargeImageList.Images.Add(get_image(die.First, die.Second.ToString()));
                lvi.ImageIndex = DiceList.LargeImageList.Images.Count - 1;

                sides.Add(die.First);
            }

            if (!fUpdating)
            {
                fUpdating          = true;
                ExpressionBox.Text = (fDice.Count != 0) ? DiceStatistics.Expression(sides, fConstant) : "";
                fUpdating          = false;
            }
        }