Add the Configuration Class
Copy
- Right click on the MyWordConverter Project in the Solution Explorer and select Add à New Folder.
- Name the new folder Configuration.
- Right click on the Configuration folder and select Add à New Item.
In the prompt, select a Visual C# Class and name it MyWordConverterConfig.cs.
Figure 6.
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" /> …- Save the Project and CS files.
Edit
MyWordConverter.csand add the new namespace:…
using Aras.ConversionFramework.Converter;
using MyWordConverter.Configuration;