| 
 | 
 
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册  
 
x
 
namespace WpfApp1 
{ 
        public class MainWindow : Window, IComponentConnector 
        { 
                private bool first; 
 
                private int hit; 
 
                private int correct; 
 
                internal StackPanel sp1; 
 
                internal Button bt1; 
 
                internal StackPanel sp2; 
 
                internal Button bt2; 
 
                internal StackPanel sp3; 
 
                internal Button bt3; 
 
                internal StackPanel sp4; 
 
                internal Button bt4; 
 
                internal StackPanel sp5; 
 
                internal Button bt5; 
 
                internal TextBlock tb1; 
 
                private bool _contentLoaded; 
 
                public MainWindow() 
                { 
                        this.InitializeComponent(); 
                        this.first = true; 
                        this.hit = 0; 
                        this.correct = 0; 
                } 
 
                private void Bt1_Click(object sender, RoutedEventArgs e) 
                { 
                        this.Btn_Checker(1); 
                } 
 
                private void Bt2_Click(object sender, RoutedEventArgs e) 
                { 
                        this.Btn_Checker(2); 
                } 
 
                private void Bt3_Click(object sender, RoutedEventArgs e) 
                { 
                        this.Btn_Checker(3); 
                } 
 
                private void Bt4_Click(object sender, RoutedEventArgs e) 
                { 
                        this.Btn_Checker(4); 
                } 
 
                private void Bt5_Click(object sender, RoutedEventArgs e) 
                { 
                        this.Btn_Checker(5); 
                } 
 
                private void Btn_Checker(int para) 
                { 
                        int[] array = new int[] 
                        { 
                                0, 
                                3, 
                                5, 
                                4, 
                                1, 
                                2, 
                                5, 
                                4, 
                                3, 
                                2, 
                                1 
                        }; 
                        bool flag = this.hit < 10; 
                        bool flag2 = flag; 
                        if (flag2) 
                        { 
                                int num = this.hit; 
                                this.hit = num + 1; 
                        } 
                        else 
                        { 
                                base.Close(); 
                        } 
                        bool flag3 = this.first; 
                        bool flag4 = flag3; 
                        if (flag4) 
                        { 
                                this.tb1.Text = ""; 
                                this.first = false; 
                        } 
                        bool flag5 = array[this.hit] == para; 
                        bool flag6 = flag5; 
                        if (flag6) 
                        { 
                                int num2 = this.correct; 
                                this.correct = num2 + 1; 
                        } 
                        bool flag7 = this.correct == 10; 
                        bool flag8 = flag7; 
                        if (flag8) 
                        { 
                                MessageBox.Show("Succeed!"); 
                                TextBlock textBlock = this.tb1; 
                                textBlock.Text = string.Concat(new string[] 
                                { 
                                        textBlock.Text, 
                                        this.sp1.Tag.ToString(), 
                                        this.sp2.Tag.ToString(), 
                                        this.sp3.Tag.ToString(), 
                                        this.sp4.Tag.ToString(), 
                                        this.sp5.Tag.ToString() 
                                }); 
                        } 
                } 
 
                [GeneratedCode("PresentationBuildTasks", "4.0.0.0"), DebuggerNonUserCode] 
                public void InitializeComponent() 
                { 
                        bool contentLoaded = this._contentLoaded; 
                        if (!contentLoaded) 
                        { 
                                this._contentLoaded = true; 
                                Uri resourceLocator = new Uri("/WpfApp1;component/mainwindow.xaml", UriKind.Relative); 
                                Application.LoadComponent(this, resourceLocator); 
                        } 
                } 
 
                [GeneratedCode("PresentationBuildTasks", "4.0.0.0"), EditorBrowsable(EditorBrowsableState.Never), DebuggerNonUserCode] 
                void IComponentConnector.Connect(int connectionId, object target) 
                { 
                        switch (connectionId) 
                        { 
                        case 1: 
                                this.sp1 = (StackPanel)target; 
                                break; 
                        case 2: 
                                this.bt1 = (Button)target; 
                                this.bt1.Click += new RoutedEventHandler(this.Bt1_Click); 
                                break; 
                        case 3: 
                                this.sp2 = (StackPanel)target; 
                                break; 
                        case 4: 
                                this.bt2 = (Button)target; 
                                this.bt2.Click += new RoutedEventHandler(this.Bt2_Click); 
                                break; 
                        case 5: 
                                this.sp3 = (StackPanel)target; 
                                break; 
                        case 6: 
                                this.bt3 = (Button)target; 
                                this.bt3.Click += new RoutedEventHandler(this.Bt3_Click); 
                                break; 
                        case 7: 
                                this.sp4 = (StackPanel)target; 
                                break; 
                        case 8: 
                                this.bt4 = (Button)target; 
                                this.bt4.Click += new RoutedEventHandler(this.Bt4_Click); 
                                break; 
                        case 9: 
                                this.sp5 = (StackPanel)target; 
                                break; 
                        case 10: 
                                this.bt5 = (Button)target; 
                                this.bt5.Click += new RoutedEventHandler(this.Bt5_Click); 
                                break; |   
 
 
 
 |