예제 #1
0
        private void beedClicked(object sender, EventArgs e)
        {
            Beed beed = (Beed)sender;

            if (beed.Empty)
            {
                return;
            }

            if (beed.Pos == 0)
            {
                beeds[1].Empty = false;
                beed.Empty     = true;
                return;
            }

            if (beed.Pos == 1)
            {
                beeds[0].Empty = false;
                beed.Empty     = true;
                return;
            }

            for (int i = 2; i < beeds.Length; i++)
            {
                if (beeds[i].Empty)
                {
                    beeds[i].Empty = false;
                    break;
                }
            }

            beed.Empty = true;
        }
예제 #2
0
        public BeedColumn()
        {
            int i = 0;

            vertbar        = new Image();
            vertbar.Source = ImageSource.FromResource("AbacusMobile.images.vertbar.png");
            vertbar.Aspect = Aspect.Fill;
            this.Children.Add(vertbar);

            horzbar = new HorzBar();
            this.Children.Add(horzbar);

            beeds[i] = new Beed(false, i);
            this.Children.Add(beeds[i]);
            i++;
            beeds[i] = new Beed(true, i);
            this.Children.Add(beeds[i]);
            i++;

            beeds[i] = new Beed(true, i);
            this.Children.Add(beeds[i]);
            i++;
            beeds[i] = new Beed(false, i);
            this.Children.Add(beeds[i]);
            i++;
            beeds[i] = new Beed(false, i);
            this.Children.Add(beeds[i]);
            i++;
            beeds[i] = new Beed(false, i);
            this.Children.Add(beeds[i]);
            i++;
            beeds[i] = new Beed(false, i);
            this.Children.Add(beeds[i]);
            i++;

            prepareBeedEvent();

            this.SizeChanged += BeedColumn_SizeChanged;
        }