public ScriptEditorConfiguration() { InitializeComponent(); foreach (var f in Fonts.SystemFontFamilies) { FontChoiceBox.Items.Add(f.Source); } FontChoiceBox.SelectedIndex = 0; DefaultCfg = null; }
public void UpdateCfgValue(DDBScriptEditor.Config cfg) { cfg.fontSource = FontChoiceBox.SelectedItem as string; Double.TryParse(FontSizeBox.Text, out cfg.fontSize); Double.TryParse(LineHeightBox.Text, out cfg.lineHeight); cfg.overwrite = OverwriteCheckBox.IsChecked == true; cfg.autoLimitMaxRowsToImport = AutolimitTableRowsCheckBox.IsChecked == true; if (cfg.autoLimitMaxRowsToImport) { int.TryParse(maxRowsToLoadIntoExcelBox.Text, out cfg.maxRowsToImportInto); } }
public void SetCfgValue(DDBScriptEditor.Config cfg) { if (cfg == null) { return; } if (FontChoiceBox.Items.Contains(cfg.fontSource)) { FontChoiceBox.SelectedItem = cfg.fontSource; } FontSizeBox.Text = cfg.fontSize.ToString(); LineHeightBox.Text = cfg.lineHeight.ToString(); OverwriteCheckBox.IsChecked = cfg.overwrite; maxRowsToLoadIntoExcelBox.Text = cfg.maxRowsToImportInto.ToString(); AutolimitTableRowsCheckBox.IsChecked = cfg.autoLimitMaxRowsToImport; }
public void SetDefaultCfg(DDBScriptEditor.Config cfg) { DefaultCfg = cfg; }