private static void ReplaceVirtualPaths(JObject jObj)
{
foreach (var p in jObj.Properties().Select(x => x.Value))
{
if (p.Type == JTokenType.Object)
{
//recurse
ReplaceVirtualPaths((JObject) p);
}
else
{
var value = p as JValue;
if (value != null)
{
if (value.Type == JTokenType.String)
{
if (value.Value<string>().StartsWith("~/"))
{
//replace the virtual path
value.Value = IOHelper.ResolveUrl(value.Value<string>());
}
}
}
}
}
}