Example #1
0
        /// <summary>
        /// Configures the component.
        /// </summary>
        /// <param name="configXml">The current configuration.</param>
        /// <returns>The updated configuration.</returns>
        public static string ConfigureComponent(string configXml)
        {
            // Open the dialog to edit the configuration
            using (var dlg = new LatexConfigDlg(configXml))
            {
                // Get the modified configuration if OK was clicked
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    _fontSize = dlg.FontSize;
                }
                var config = XElement.Parse(configXml);
                config.Element("fontSize").Attribute("value").SetValue(_fontSize);
                configXml = config.ToString();
            }

            // Return the configuration data
            return(configXml);
        }
Example #2
0
            /// <inheritdoc />
            public override string ConfigureComponent(string currentConfiguration, CompositionContainer container)
            {
                // Open the dialog to edit the configuration
                using (var dlg = new LatexConfigDlg(currentConfiguration))
                {
                    // Get the modified configuration if OK was clicked
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        _fontSize = dlg.FontSize;

                        var config = XElement.Parse(currentConfiguration);

                        config.Element("fontSize").Attribute("value").SetValue(_fontSize);
                        currentConfiguration = config.ToString();
                    }
                }

                // Return the configuration data
                return(currentConfiguration);
            }