private void InitializeParametersGroup() { ParametersStackPanelName.Children.Clear(); ParametersStackPanelValue.Children.Clear(); List <ResearchParameter> researchParameters = LabSessionManager.GetRequiredResearchParameters(researchType); foreach (ResearchParameter p in researchParameters) { TextBlock pName = new TextBlock { Text = p.ToString() + ":", Margin = new Thickness(7), Name = p.ToString() + "Name" }; ParametersStackPanelName.Children.Add(pName); if (GetTypeForResearchParameter(p) == typeof(Boolean)) { CheckBox pValue = new CheckBox() { Margin = new Thickness(50, 5, 50, 5), BorderBrush = (SolidColorBrush) new BrushConverter().ConvertFromString("#aaaaaa") }; ParametersStackPanelValue.Children.Add(pValue); } else { TextBox pValue = new TextBox { Height = 20, Width = 100, Margin = new Thickness(5), Name = p.ToString(), Text = GetDefaultValueForResearchParameter(p) }; ParametersStackPanelValue.Children.Add(pValue); } } List <GenerationParameter> generationParameters = LabSessionManager.GetRequiredGenerationParameters(researchType, GetCurrentModelType()); foreach (GenerationParameter p in generationParameters) { TextBlock pName = new TextBlock { Text = p.ToString() + ":", Margin = new Thickness(7), Name = p.ToString() + "Name" }; ParametersStackPanelName.Children.Add(pName); TextBox pValue = new TextBox { Height = 20, Width = 100, Margin = new Thickness(5), Name = p.ToString(), Text = GetDefaultValueForGenerationParameter(p) }; ParametersStackPanelValue.Children.Add(pValue); } }
private void InitializeEditResearchDialog() { ResearchTypeTextBox.Text = LabSessionManager.GetResearchType().ToString(); ResearchNameTextBox.Text = LabSessionManager.GetResearchName(); ModelTypeComboBox.Text = LabSessionManager.GetResearchModelType().ToString(); Dictionary <GenerationParameter, object> paramValues = LabSessionManager.GetGenerationParameterValues(); List <ResearchParameter> param = LabSessionManager.GetRequiredResearchParameters(LabSessionManager.GetResearchType()); for (int i = 0; i < ParametersStackPanelValue.Children.Count; i++) { GenerationParameter g; Enum.TryParse(((TextBox)ParametersStackPanelValue.Children[i]).Name, out g); ((TextBox)(ParametersStackPanelValue.Children[i])).Text = paramValues[g].ToString(); } }