private void SetGenerationSettings(string xmlFileName) { GenerationSettings settings = SerializeHelper.XmlDeserialize <GenerationSettings>(xmlFileName); this.languageCombx.Text = settings.Language; this.templateEngineCombox.Text = settings.TemplateEngine; this.packageTxtBox.Text = settings.Package; this.tablePrefixTxtBox.Text = settings.TablePrefix; this.authorTxtBox.Text = settings.Author; this.versionTxtBox.Text = settings.Version; this.codeFileEncodingCombox.Text = settings.Encoding; this.isOmitTablePrefixChkbox.Checked = settings.IsOmitTablePrefix; this.isStandardizeNameChkbox.Checked = settings.IsCamelCaseName; this.templateListBox.Items.Clear(); foreach (string templateName in settings.TemplatesNames) { TemplateElement template = ConfigManager.TemplateSection.Templates[templateName]; TemplateListBoxItem item = new TemplateListBoxItem(template.Name, template.DisplayName); this.templateListBox.Items.Add(item); this.templateListBox.SelectedItems.Add(item); this.templateListBox.DisplayMember = "DisplayName"; } }
private void SetGenerationSettings(string xmlFileName) { GenerationSettings settings = SerializeHelper.XmlDeserialize<GenerationSettings>(xmlFileName); this.languageCombx.Text = settings.Language; this.templateEngineCombox.Text = settings.TemplateEngine; this.packageTxtBox.Text = settings.Package; this.tablePrefixTxtBox.Text = settings.TablePrefix; this.authorTxtBox.Text = settings.Author; this.versionTxtBox.Text = settings.Version; this.codeFileEncodingCombox.Text = settings.Encoding; this.isOmitTablePrefixChkbox.Checked = settings.IsOmitTablePrefix; this.isStandardizeNameChkbox.Checked = settings.IsStandardizeName; this.templateListBox.Items.Clear(); foreach (string templateName in settings.TemplatesNames) { TemplateElement template = ConfigManager.TemplateSection.Templates[templateName]; TemplateListBoxItem item = new TemplateListBoxItem(template.Name, template.DisplayName); this.templateListBox.Items.Add(item); this.templateListBox.SelectedItems.Add(item); this.templateListBox.DisplayMember = "DisplayName"; } }