private void Target(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent(typeof(ImageOfBall)) && ((ImageOfBall)sender).Opacity == 0)
     {
         flagEvent = true;
         ImageOfBall f = e.Data.GetData(typeof(ImageOfBall)) as ImageOfBall;
         ((ImageOfBall)sender).number  = f.number;
         ((ImageOfBall)sender).Source  = f.Source;
         ((ImageOfBall)sender).Opacity = 1;
     }
 }
Esempio n. 2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\BullsAndCows.xaml"
                ((MyGame.BullsAndCows)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.FirstGame_Closing);

            #line default
            #line hidden
                return;

            case 2:
                this.GameGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.Cow2 = ((System.Windows.Controls.Image)(target));
                return;

            case 4:
                this.OpacityBtn = ((System.Windows.Controls.Button)(target));

            #line 15 "..\..\BullsAndCows.xaml"
                this.OpacityBtn.Click += new System.Windows.RoutedEventHandler(this.OpacityBtn_Click);

            #line default
            #line hidden
                return;

            case 5:

            #line 23 "..\..\BullsAndCows.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.NewGame_Click);

            #line default
            #line hidden
                return;

            case 6:

            #line 24 "..\..\BullsAndCows.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Progress_Click);

            #line default
            #line hidden
                return;

            case 7:

            #line 25 "..\..\BullsAndCows.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Reference_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.B3 = ((MyGame.ImageOfBall)(target));
                return;

            case 9:
                this.B4 = ((MyGame.ImageOfBall)(target));
                return;

            case 10:
                this.B2 = ((MyGame.ImageOfBall)(target));
                return;

            case 11:
                this.B1 = ((MyGame.ImageOfBall)(target));
                return;

            case 12:
                this.Ball2 = ((MyGame.ImageOfBall)(target));
                return;

            case 13:
                this.Ball4 = ((MyGame.ImageOfBall)(target));
                return;

            case 14:
                this.Ball0 = ((MyGame.ImageOfBall)(target));
                return;

            case 15:
                this.Ball6 = ((MyGame.ImageOfBall)(target));
                return;

            case 16:
                this.Ball8 = ((MyGame.ImageOfBall)(target));
                return;

            case 17:
                this.Ball1 = ((MyGame.ImageOfBall)(target));
                return;

            case 18:
                this.Ball3 = ((MyGame.ImageOfBall)(target));
                return;

            case 19:
                this.Ball5 = ((MyGame.ImageOfBall)(target));
                return;

            case 20:
                this.Ball7 = ((MyGame.ImageOfBall)(target));
                return;

            case 21:
                this.Ball9 = ((MyGame.ImageOfBall)(target));
                return;

            case 22:
                this.TableOfResults = ((System.Windows.Controls.TextBox)(target));
                return;
            }
            this._contentLoaded = true;
        }