public void Reload() { Logs.Children.Clear(); ProjectControlSource source = PersistableJson.Load <ProjectControlSource>(); foreach (ProjectControlItem item in source.Logs) { RadioButton but = new RadioButton(); but.Content = item.LogPath; but.GroupName = "group"; Logs.Children.Add(but); } }
public void Reload() { log.Debug("Reload called"); checkcount = 0; projectRowsPanel.Children.Clear(); source = PersistableJson.Load <ProjectControlSource>(); log.Debug(source.Items + "items are in the project control source"); foreach (ProjectControlSourceItem item in source.Items) { ProjectControl row = new ProjectControl(); row.StatusUpdated += Row_StatusUpdated; row.Reload(item, source); row.trivialBump_RB.GroupName = "bumpGroup" + item.Project; row.minorBump_RB.GroupName = "bumpGroup" + item.Project; row.majorBump_RB.GroupName = "bumpGroup" + item.Project; projectRowsPanel.Children.Add(row); } foreach (FTPHost host in source.FTPHosts) { CheckBox ftpcheck = new CheckBox { Content = host.IPAddress, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(10, 0, 0, 0) }; ftpcheck.DataContext = host; ftpcheck.SetBinding(ToggleButton.IsCheckedProperty, "Checked"); ftpcheck.Checked += Ftpcheck_Checked; ftpcheck.Unchecked += Ftpcheck_Unchecked; if (host.Checked == true) { checkcount++; } ServerChoices.Children.Add(ftpcheck); } if (checkcount < 1) { foreach (ProjectControl pc in projectRowsPanel.Children) { pc.DeployButton.IsEnabled = false; } } }