If you need structured data Jeff, then pass in the XML, otherwise just pass in plain text.
To parse out that XML string you can use namespace System.Xml.Linq
.
Here is a sample XML structure in the cms_class table to get fields.
<form version="2">
<field column="RoleID" columntype="integer" fieldtype="CustomUserControl" isPK="true" system="true" publicfield="false" guid="0c8cc1de-1c82-4596-b6d0-b2c60bcad3b7" reftype="Required">
<properties>
<fieldcaption>RoleID</fieldcaption>
</properties>
<settings>
<controlname>labelcontrol</controlname>
</settings>
</field>
<field column="RoleDisplayName" visible="true" columntype="text" fieldtype="CustomUserControl" system="true" columnsize="100" publicfield="false" guid="c5f83fe3-f362-431f-80be-2d40122e469e" translatefield="true" reftype="Required">
<properties>
<fieldcaption>Role display name</fieldcaption>
</properties>
<settings>
<controlname>localizabletextbox</controlname>
<ValueIsContent>False</ValueIsContent>
</settings>
</field>
</form>
I use it something like this when I get the ClassFormDefinition
out of the cms.class table.
var doc = XDocument.Parse(dci.ClassFormDefinition);
// get a list of all the tables properties by column value
List<string> elements = doc.Descendants("field").Select(el => el.Attribute("column").Value).ToList();
// got the class properties now compare
foreach (string s in elements)
{
// see if the class info contains the column in the data row passed in this method
if (Row.Table.Columns.Contains(s))
{
// contains the column so set a value
newCustomTableItem.SetValue(s, Row[s]);
okInsert = true;
}
}
This code gets all the <field>
and gets the column
attribute value and puts them into a list of strings. Then I compare that list to a list of columns in a custom table and if they match, then I map the values.
So maybe a bit overkill for what you're looking for but a good example none the less.