private static string GetImageAnnotationHtml(aim4_dotnet.ImageAnnotation imageAnnotation, aim4_dotnet.User aimUserInfo) { StringBuilder sb = new StringBuilder(); AimHtmlFormatter htmlFormatter = new AimHtmlFormatter(); Color ctrlColor = Color.FromKnownColor(KnownColor.Control); Color fontColor = Color.FromKnownColor(KnownColor.WindowText); sb.Append(HtmlDocHeader); sb.AppendFormat("<body style=\"background-color: #{0}{1}{2};\" onload=\"setupPaths(['{3}', '{4}'])\">", ctrlColor.R.ToString("X2"), ctrlColor.G.ToString("X2"), ctrlColor.B.ToString("X2"), MinusImagePathName, PlusImagePathName); sb.Append("<div id=\"main_content\">"); sb.AppendFormat("<div><b>Name: {0}</b></div>", imageAnnotation.Name); sb.AppendFormat("<div>Number of Geometric Shapes: {0}</div>", imageAnnotation.MarkupEntityCollection == null ? 0 : imageAnnotation.MarkupEntityCollection.Count(geoShape => geoShape is aim4_dotnet.GeometricShapeEntity)); sb.AppendFormat("<div>Number of Text Annotations: {0}</div>", imageAnnotation.MarkupEntityCollection == null ? 0 : imageAnnotation.MarkupEntityCollection.Count(geoShape => geoShape is aim4_dotnet.TextAnnotationEntity)); if (aimUserInfo != null) { sb.AppendFormat("<div>Created by: {0}</div>", aimUserInfo.Name); } sb.Append(htmlFormatter.GetImagingPhysicalEntitiesHtml(imageAnnotation.ImagingPhysicalEntityCollection)); sb.Append(htmlFormatter.GetImagingObservationHtml(imageAnnotation.ImagingObservationEntityCollection)); // TODO - append other sections sb.Append("</div>"); sb.Append("</body>"); sb.Append("</html>"); return(sb.ToString()); }
private static string GetImageAnnotationHtml(aim4_dotnet.ImageAnnotation imageAnnotation, aim4_dotnet.User aimUserInfo) { StringBuilder sb = new StringBuilder(); AimHtmlFormatter htmlFormatter = new AimHtmlFormatter(); Color ctrlColor = Color.FromKnownColor(KnownColor.Control); Color fontColor = Color.FromKnownColor(KnownColor.WindowText); sb.Append(HtmlDocHeader); sb.AppendFormat("<body style=\"background-color: #{0}{1}{2};\" onload=\"setupPaths(['{3}', '{4}'])\">", ctrlColor.R.ToString("X2"), ctrlColor.G.ToString("X2"), ctrlColor.B.ToString("X2"), MinusImagePathName, PlusImagePathName); sb.Append("<div id=\"main_content\">"); sb.AppendFormat("<div><b>Name: {0}</b></div>", imageAnnotation.Name); sb.AppendFormat("<div>Number of Geometric Shapes: {0}</div>", imageAnnotation.MarkupEntityCollection == null ? 0 : imageAnnotation.MarkupEntityCollection.Count(geoShape => geoShape is aim4_dotnet.GeometricShapeEntity)); sb.AppendFormat("<div>Number of Text Annotations: {0}</div>", imageAnnotation.MarkupEntityCollection == null ? 0 : imageAnnotation.MarkupEntityCollection.Count(geoShape => geoShape is aim4_dotnet.TextAnnotationEntity)); if (aimUserInfo != null) sb.AppendFormat("<div>Created by: {0}</div>", aimUserInfo.Name); sb.Append(htmlFormatter.GetImagingPhysicalEntitiesHtml(imageAnnotation.ImagingPhysicalEntityCollection)); sb.Append(htmlFormatter.GetImagingObservationHtml(imageAnnotation.ImagingObservationEntityCollection)); // TODO - append other sections sb.Append("</div>"); sb.Append("</body>"); sb.Append("</html>"); return sb.ToString(); }