private string PopulateResources(Resource currentRoot, String baseUri)
{
Resource[] resources = currentRoot.GetSubResources();
string returnLi="";
foreach (Resource res in resources)
{
if (res.SubResourceCount > 0)
{
returnLi += PopulateResources(res, baseUri);
}
else
{
if (res.ResourceType != null && res.ResourceType.ToLower() == "observe")
{
returnLi += String.Format("<li><a href=\"{0}\">{1}</a><br/><span>*can be observed*</span><br/><span>*resource title:{2}</span></li>", baseUri.Replace("coap", "http") + res.Path, res.Path.Substring(1, res.Path.Length - 1), res.Title);
}
else
{
returnLi += String.Format("<li><a href=\"{0}\">{1}</a><br/><span>*resource title:{2}</span></li>", baseUri.Replace("coap", "http") + res.Path, res.Path.Substring(1, res.Path.Length - 1), res.Title);
}
}
}
return returnLi;
}