Esempio n. 1
0
        public void NextButton_Click(object sender, RoutedEventArgs re)
        {
            string[] fileSystemEntries = Directory.GetFileSystemEntries(path());
            for (int i = 0; i < fileSystemEntries.Length; i++)
            {
                string text = fileSystemEntries[i].ToUpper();
                if (text.IndexOf("TBT.BIN") > 0)
                {
                    FileName = text;
                }
            }
            if (PageContent.Content is WelcomeScreen)
            {
                Thread.Sleep(1000);
                int num = battery_check();
                while (num == 0 || num == 2)
                {
                    switch (num)
                    {
                    case 0:
                        break;

                    case 2:
                        goto IL_00b6;

                    default:
                        continue;
                    }
                    string a = prompt();
                    if (a == "OK")
                    {
                        num = battery_check();
                    }
                    else if (a != "OK")
                    {
                        tbt_reset();
                        Thread.Sleep(3000);
                        tbtoff();
                        Environment.Exit(21);
                        break;
                    }
                    continue;
IL_00b6:
                    string a2 = Prompt_battrty_low();
                    if (a2 == "OK")
                    {
                        num = battery_check();
                    }
                    else if (a2 != "OK")
                    {
                        tbt_reset();
                        Thread.Sleep(3000);
                        tbtoff();
                        Environment.Exit(22);
                        break;
                    }
                }
                if (num == 1)
                {
                    try
                    {
                        CurrentController.ValidateImage(FileName);
                        SafeModeWarning();
                        _flashTask.Start();
                    }
                    catch (Exception ex)
                    {
                        string text2 = ex.Message;
                        if (ex is ManagementException)
                        {
                            text2 = "WMI error: " + text2;
                        }
                        seterrorcode(text2);
                        return;
                    }
                }
            }
            ((System.Windows.Controls.Button)Steps.Children[_currentScreen]).Style = (FindResource("WizardStepStyle") as Style);
            PageContent.Content = _pages[++_currentScreen];
            base.DataContext    = PageContent.Content;
            ((System.Windows.Controls.Button)Steps.Children[_currentScreen]).Style = (FindResource("CurrentWizardStepStyle") as Style);
        }