I have an ItemFields object which has got all the ItemFields of a Component.
I want to remove a particular ItemField from it and return the entire ItemFields collection, so the code should be as below:
public static void WriteAllNodes(this XmlWriter Xml, ItemFields itemFields, String ignoreFieldNames)
{
if (!String.IsNullOrEmpty(ignoreFieldNames))
{
String[] strSplitFields = ignoreFieldNames.Split(',');
foreach (String fieldName in strSplitFields)
{
if (itemFields != null && itemFields.Contains(fieldName))
{
itemFields = itemFields.RemoveItemField(fieldName);
//What could be the best logic for this RemoveItemField function?
}
}
}
}
But the API does not contain a method ItemFields.RemoveItemField()
, what can I use to remove an ItemField from the ItemFields?