Add the Configuration Class

  1. Right click on the MyWordConverter Project in the Solution Explorer and select Add à New Folder.
  2. Name the new folder Configuration.
  3. Right click on the Configuration folder and select Add à New Item.
  4. In the prompt, select a Visual C# Class and name it MyWordConverterConfig.cs.

    Figure 6.

  5. Set the following code in this new file. This code sets which tags and parameters will be available for configuration in the Conversion Server

    configuration file.
    
    using System;
    
    using System.Collections.Generic;
    
    using System.Linq;
    
    using System.Text;
    
    using System.Configuration;
    
    namespace MyWordConverter.Configuration
    {
        class MyWordConverterConfig : ConfigurationSection
        {
            [ConfigurationProperty("Settings", IsRequired = true)]                                                    
            public SettingsElement Settings
            {
                get                                                    
                {
                    return (SettingsElement)this["Settings"];                                                   
                }
                set                                               
                {
                    this["Settings"] = value;                                                    
                }
    
            }
    
        }
        public class SettingsElement : ConfigurationElement
        {
            [ConfigurationProperty("pdfSuffix", IsRequired = true)]                                                    
            public String PdfSuffix
            {
                get                                                    
                {
    
                    return (String)this["pdfSuffix"];                                                    
                }
    
                set                                                    
                {
                    this["pdfSuffix"] = value;                                                    
                }
            }
        }
    }

    The above code corresponds with the following tag in the \ConversionServerConfig.xml in the root of your Aras Conversion Server installation:

    <ConverterSettings>
    
    <MyWordConverter>
    
      <Settings pdfSuffix="_X" />
    
      …

  6. Save the Project and CS files.
  7. Edit MyWordConverter.cs and add the new namespace:

    using Aras.ConversionFramework.Converter;

    using MyWordConverter.Configuration;