예제 #1
0
 public Game(MineField mineField, CounterControl minesCounter, CounterControl timeCounter)
 {
     this.mineField    = mineField;
     this.minesCounter = minesCounter;
     this.timeCounter  = timeCounter;
     timer             = new DispatcherTimer();
     timer.Tick       += (sender, e) => { timeCounter.Number++; };
     timer.Interval    = new TimeSpan(0, 0, 1);
 }
예제 #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.GameDockPanel = ((System.Windows.Controls.DockPanel)(target));
                return;

            case 2:
                this.GameMenu = ((System.Windows.Controls.Menu)(target));
                return;

            case 3:

            #line 16 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 4:

            #line 18 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 5:

            #line 19 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 6:

            #line 20 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 7:

            #line 22 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.emotionsBtn = ((Minesweeper_WPF.EmotionsButton)(target));
                return;

            case 9:
                this.timer = ((Minesweeper_WPF.CounterControl)(target));
                return;

            case 10:
                this.minesCounter = ((Minesweeper_WPF.CounterControl)(target));
                return;

            case 11:
                this.mineField = ((Minesweeper_WPF.MineField)(target));
                return;
            }
            this._contentLoaded = true;
        }