public static ctrl_TableList add_Jint_Stats_Row(this ctrl_TableList tableList, int index, string url, string html, HtmlAgilityPack.HtmlDocument htmlDocument, List <KeyValuePair <string, string> > javaScripts) { var links = htmlDocument.select("//a"); var images = htmlDocument.select("//img"); var forms = htmlDocument.select("//form"); var allJavaScriptsCompileOk = javaScripts.allJavaScriptsCompileOk(); var allJavaScriptCompiledAst = javaScripts.jint_Compile(); var sizeOfJointJavaScripts = javaScripts.getStringWithJointJavascripts().size(); //var scripts = htmlDocument.select("//script"); tableList.add_Row( "{0:00}".format(index), //(mapped++).str(), url, "{0:000}".format(links.size()), "{0:000}".format(images.size()), "{0:000}".format(forms.size()), "{0:000}".format(javaScripts.size()), allJavaScriptsCompileOk.str(), "{0:0000}".format(allJavaScriptCompiledAst.functions().size()), "{0:0000}".format(allJavaScriptCompiledAst.values().size()), sizeOfJointJavaScripts.kBytesStr(), javaScripts.totalValueSize().kBytesStr(), html.size().kBytesStr() ); tableList.lastRow().textColor((allJavaScriptsCompileOk) ? Color.DarkGreen : Color.DarkRed); return(tableList); }
public static ctrl_TableList show_in_TableList(this List <ManagementBaseObject> searchResults, ctrl_TableList tableList) { if (searchResults.isNull() || tableList.isNull()) { return(tableList); } var wmiQueryItems = searchResults.createObjectWithSearchResults(); if (wmiQueryItems.isNull() || wmiQueryItems.size() == 0) { tableList.title("No items in WMI search results"); return(tableList); } tableList.visible(false); var properties = wmiQueryItems[0].type().properties(); foreach (var property in properties) { tableList.add_Column(property.Name); } foreach (var wmiQueryItem in wmiQueryItems) { tableList.add_Row(wmiQueryItem.getProperties_AsArray().Select <object, string>(o => o.str()).toList()); } tableList.title("Showing {0} values form {1} search results".format(properties.size(), searchResults.size())); tableList.visible(true); return(tableList); }
public static ctrl_TableList show(this ctrl_TableList tableList, object targetObject) { if (tableList.notNull() && targetObject.notNull()) { tableList.clearTable(); tableList.title("{0}".format(targetObject.typeFullName())); tableList.add_Columns("name", "value"); foreach (var property in PublicDI.reflection.getProperties(targetObject)) { tableList.add_Row(property.Name, targetObject.prop(property.Name).str()); } tableList.makeColumnWidthMatchCellWidth(); } return(tableList); }
public static ctrl_TableList add_Row(this ctrl_TableList tableList, params string[] cellValues) { tableList.add_Row(cellValues.toList()); return(tableList); }