Change PluginVisitor to set the TaskCompletionSource to an empty list when Visit is never called

Slightly nicer behaviour than timing out
Update the example
This commit is contained in:
amaitland
2016-04-15 15:44:35 +10:00
parent 4de3a1795d
commit e2a690dca9
3 changed files with 18 additions and 20 deletions
+12 -12
View File
@@ -196,10 +196,19 @@ namespace CefSharp.Example
pluginBody.Append("<th>Path</th>");
pluginBody.Append("</tr>");
try
{
var plugins = await Cef.GetPlugins();
var plugins = await Cef.GetPlugins();
if(plugins.Count == 0)
{
pluginBody.Append("<tr>");
pluginBody.Append("<td colspan='4'>Cef.GetPlugins returned an empty list - likely no plugins were loaded on your system</td>");
pluginBody.Append("</tr>");
pluginBody.Append("<tr>");
pluginBody.Append("<td colspan='4'>You may find that NPAPI/PPAPI need to be enabled</td>");
pluginBody.Append("</tr>");
}
else
{
foreach (var plugin in plugins)
{
pluginBody.Append("<tr>");
@@ -210,15 +219,6 @@ namespace CefSharp.Example
pluginBody.Append("</tr>");
}
}
catch (TaskCanceledException ex)
{
pluginBody.Append("<tr>");
pluginBody.Append("<td colspan='4'>Cef.GetPlugins Timed out - likely no plugins were loaded on your system</td>");
pluginBody.Append("</tr>");
pluginBody.Append("<tr>");
pluginBody.Append("<td colspan='4'>You may find that NPAPI/PPAPI need to be enabled</td>");
pluginBody.Append("</tr>");
}
pluginBody.Append("</table></body></html>");