private bool ProcessContent(IRequestInfo info, string localPath)
{
if (localPath.EndsWith(".css"))
{
return ProcessCssFile(info, localPath);
}
switch (localPath)
{
case "currentPageContent":
info.ContentType = "text/html";
info.WriteCompleteOutput(CurrentPageContent ?? "");
return true;
case "toolboxContent":
info.ContentType = "text/html";
info.WriteCompleteOutput(ToolboxContent ?? "");
return true;
case "availableFontNames":
info.ContentType = "application/json";
var list = new List<string>(Browser.NamesOfFontsThatBrowserCanRender());
list.Sort();
info.WriteCompleteOutput(JsonConvert.SerializeObject(new{fonts = list}));
return true;
case "authorMode":
info.ContentType = "text/plain";
info.WriteCompleteOutput(AuthorMode ? "true" : "false");
return true;
case "topics":
return GetTopicList(info);
}
return ProcessAnyFileContent(info, localPath);
}