Пример #1
0
        public XBAPTest()
        {
            InitializeComponent();

            _xbb = new XBAPBall [_N];

            for (int i = 0; i < _N; i++)
            {
                BallControl bc = new BallControl();
                ((Canvas)(start.Parent)).Children.Add(bc);

                _xbb[i] = new XBAPBall(bc);
            }

            start.Click += new RoutedEventHandler(start_Click);
            stop.Click += new RoutedEventHandler(stop_Click);

            _move = new DispatcherTimer();
            _move.Interval = new TimeSpan(0, 0, 0, 0, 5);
            _move.Tick += new EventHandler(_move_Tick);
            _move.Start();

            _showFps = new DispatcherTimer();
            _showFps.Interval = new TimeSpan(0, 0, 0, 3);
            _showFps.Tick += new EventHandler(_move_UpdateFPS);
            _showFps.Start();
        }
Пример #2
0
 public XBAPBall(BallControl item)
     : base()
 {
     this._item = item;
     this.move();
 }
Пример #3
0
 public XBAPBall(BallControl item, int x, int y, int vx, int vy)
     : base(x, y, vx, vy)
 {
     this._item = item;
     this.move();
 }