Thanks Pero, I had already created another method which is not as elegant as yours but will parse the JSON string without the need to bother with the deserialization. I've included my code here for the convenience of others. Also of note, do not assign a name of "ID" for an attribute as the JSON serialization process appears to strip that from the attributes list. Make sure to append "ID" with something or use a different name all together. It is important when manually parsing to leave the original string intact for the most part as there is no guarrantee that in future updates or calls the items contained in the string will be in the same order. So mapping the original attributes of the object as well as any attribute which is actually an array is essential for continued success.
public class radExtenders
{
public static RadTreeNode BuildNodeFromJSONstring(String myString)
{
RadTreeNode myNode = new RadTreeNode();
//Get rid of Quotes
myString = myString.Replace("\"", "");
//Retrieve the original Node value
int nodeValueStart = myString.IndexOf("value:");
string myNodeString = myString.Remove(0, nodeValueStart + 6);
int nodeValueEnd = myNodeString.IndexOf(",");
myNode.Value = myNodeString.Substring(0, nodeValueEnd);
//Retrieve category name
int CategoryNameStart = myString.IndexOf("category:");
string myCategoryString = myString.Remove(0, CategoryNameStart + 9);
int CategoryNameEnd = myCategoryString.IndexOf(",");
myNode.Category = myCategoryString.Substring(0, CategoryNameEnd);
//Find then retrieve the attributes if any
int AttribStart = myString.IndexOf("attributes:");
if (AttribStart > -1)
{
string strAttribList = myString.Remove(0, AttribStart + 12);
int AttribEnd = strAttribList.IndexOf("}");
strAttribList = strAttribList.Substring(0, AttribEnd);
while (strAttribList.Length > 0)
{
int NameFinder = strAttribList.IndexOf(":");
string strName = strAttribList.Substring(0, NameFinder);
strAttribList = strAttribList.Remove(0, NameFinder + 1);
int ValueFinder = strAttribList.IndexOf(",");
string strValue = string.Empty;
if (ValueFinder > -1)
{
strValue = strAttribList.Substring(0, ValueFinder);
strAttribList = strAttribList.Remove(0, ValueFinder + 1);
}
else
{
strValue = strAttribList;
strAttribList = string.Empty;
}
myNode.Attributes.Add(strName, strValue);
//Remove after testing
if (strName == "ctgID")
{
string stopHere = "StopHere";
}
}
}
//Find Text value for node
int TextValueStart = myString.IndexOf("text:");
string myTextString = myString.Remove(0, TextValueStart + 5);
int TextValueEnd = myTextString.IndexOf(",");
if (TextValueEnd > -1)
{
myNode.Text = myTextString.Substring(0, TextValueEnd);
}
else
{
myNode.Text = myTextString.Substring(0, myTextString.Length - 2);
}
return myNode;
}
}