コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();
            Title = MyApp.AppSettings.ApplicationNameWithVersion;
            DockerInternalAddressWarningIsOk.SetVisible(false);
            EnvironmentContainer.SetVisible(false);

            Clear_Click(null, null);
            lastSaver = new LastSaver(MyApp.BuilderFolder);

            YourUID.Text                       = MyApp.AppStorage.YourUid;
            RunInSequence.IsChecked            = MyApp.AppStorage.RunInSequence;
            CloseApplicationAfterRun.IsChecked = MyApp.AppStorage.CloseApplicationAfterRun;
            UpdateStatusBar();
            UpdateAfterChecked(null, null);
        }
コード例 #2
0
        private async void BaseWindow_Loaded(object sender, RoutedEventArgs e)
        {
            if (MyApp.EgwFolder == null)
            {
                await Task.Delay(1);

                Wizzard();
            }
            else
            {
                Console.Text = "Loading versions...";
                await Task.Delay(1);

                try
                {
                    var version = MyApp.Runner.GetVersions(MyApp.BuilderFolder, MyApp.EgwFolder);
                    MyApp.Runner.RetrieveInfo(MyApp.BuilderFolder, MyApp.EgwFolder);
                    Console.Text = version + "\n\nBranches\n" + MyApp.Runner.Info.GetBranches();
                    var info = MyApp.Runner.Info;
                    additionalTestModels        = info.AdditionalTests.Select(test => new AdditionalTestModel(test)).ToList();
                    AdditionalTests.ItemsSource = additionalTestModels;
                    AdditionalTestsContainer.SetVisible(additionalTestModels.Count > 0);
                    if (!info.ContainsProject("IEC"))
                    {
                        IEC.IsEnabled = false;
                        ForProject("IEC", ch => ch.IsEnabled = false);
                    }
                    if (!info.ContainsProject("AS24"))
                    {
                        AS24.IsEnabled = false;
                        ForProject("AS24", ch => ch.IsEnabled = false);
                    }
                    foreach (var project in info.Projects)
                    {
                        if (!project.SupportTests && FindName("Test_" + project.CodeForComponent) != null)
                        {
                            (FindName("Test_" + project.CodeForComponent) as CheckBox).IsEnabled = false;
                        }
                    }
                    MessageBroker.Text = info.MessageBroker;
                    if (string.IsNullOrWhiteSpace(info.MessageBroker))
                    {
                        MessageBrokerLabel.Foreground = Brushes.Red;
                        MessageBrokerLabel.ToolTip    = "Subapps have different brokers. You can set same broker for all subApps here.";
                    }
                    if (info.IsEnvironmentsShowable)
                    {
                        EnvironmentContainer.SetVisible(true);
                        Environment.Items.Clear();
                        Environment.ItemsSource   = info.GetEnvironments();
                        Environment.SelectedIndex = 0;
                    }
                }
                catch (Exception ex)
                {
                    Console.Text = "Error: " + ex.Message + "\n" + ex.StackTrace;
                }
                await Task.Delay(1);

                try
                {
                    if (MyApp.Runner.IsDockerAddressOk())
                    {
                        DockerInternalAddressWarning.SetVisible(false);
                        DockerInternalAddressWarningIsOk.SetVisible(true);
                    }
                    else
                    {
                        DockerInternalAddressWarning.Text = "WARNING: ip address host.docker.internal is binded to " + MyApp.Runner.GetDockerAddress()
                                                            + ", which is not address of this computer (ipconfig). Restart Docker Desktop from context menu of Docker Desktop icon in system tray. " +
                                                            "Otherwise AsyncJob and other services will not work correctly.";
                    }
                }
                catch (Exception ex)
                {
                    Console.Text = "Error: " + ex.Message + "\n" + ex.StackTrace;
                }
            }
        }