private static HtmlElement CreateTypeNameSpan(Type type) { string typeName = GetTypeName(type); HtmlElement span = new HtmlElement("span"); StringBuilder sb = new StringBuilder(); // Convert the type name into html elements with different css classes foreach (var ch in typeName) { if (IsOperator(ch)) { if (sb.Length > 0) { span.AppendChild(CreateTypeSpan(sb.ToString())); sb.Clear(); } span.AppendChild(CreateOperatorSpan(ch.ToString())); } else { sb.Append(ch); } } if (sb.Length > 0) { span.AppendChild(CreateTypeSpan(sb.ToString())); } return(span); }
private static HtmlElement CreateExceptionSpan(ObjectVisitorException exception) { HtmlElement span = new HtmlElement("span"); span.AppendChild(HelpersResources.ObjectInfo_PropertyThrewException); span.AppendChild(HtmlElement.CreateSpan(exception.InnerException.Message, "exception")); return(span); }
public override void VisitEnumeratonLimitExceeded() { HtmlElement li = new HtmlElement("li"); li.AppendChild("..."); Current.AppendChild(li); }
private static HtmlElement CreateParentSpan(params HtmlElement[] elements) { HtmlElement span = new HtmlElement("span"); foreach (var e in elements) { span.AppendChild(e); } return(span); }
public override void VisitIndexedEnumeratedValue(int index, object item, int depth) { HtmlElement li = new HtmlElement("li"); li.AppendChild(String.Format(CultureInfo.InvariantCulture, "[{0}] = ", index)); PushElement(li); base.VisitIndexedEnumeratedValue(index, item, depth); PopElement(); Current.AppendChild(li); }
public override void VisitKeyValue(object key, object value, int depth) { HtmlElement keyElement = new HtmlElement("span"); PushElement(keyElement); Visit(key, depth); PopElement(); HtmlElement valueElement = new HtmlElement("span"); PushElement(valueElement); Visit(value, depth); PopElement(); // Append the elements to the li HtmlElement li = new HtmlElement("li"); li.AppendChild(keyElement); li.AppendChild(" = "); li.AppendChild(valueElement); Current.AppendChild(li); }
public override void VisitMember(string name, Type type, object value, int depth) { HtmlElement li = new HtmlElement("li"); if (type != null) { li.AppendChild(CreateTypeNameSpan(type)); li.AppendChild(" "); } li.AppendChild(CreateNameSpan(name)); li.AppendChild(" = "); PushElement(li); _excludeTypeName = true; base.VisitMember(name, type, value, depth); _excludeTypeName = false; PopElement(); Current.AppendChild(li); }
private static HtmlElement CreateTypeNameSpan(Type type) { string typeName = GetTypeName(type); HtmlElement span = new HtmlElement("span"); StringBuilder sb = new StringBuilder(); // Convert the type name into html elements with different css classes foreach (var ch in typeName) { if (IsOperator(ch)) { if (sb.Length > 0) { span.AppendChild(CreateTypeSpan(sb.ToString())); sb.Clear(); } span.AppendChild(CreateOperatorSpan(ch.ToString())); } else { sb.Append(ch); } } if (sb.Length > 0) { span.AppendChild(CreateTypeSpan(sb.ToString())); } return span; }
private static HtmlElement CreateExceptionSpan(ObjectVisitorException exception) { HtmlElement span = new HtmlElement("span"); span.AppendChild(HelpersResources.ObjectInfo_PropertyThrewException); span.AppendChild(HtmlElement.CreateSpan(exception.InnerException.Message, "exception")); return span; }
private static HtmlElement CreateParentSpan(params HtmlElement[] elements) { HtmlElement span = new HtmlElement("span"); foreach (var e in elements) { span.AppendChild(e); } return span; }