//internal static string GetAimHtml(aim4_dotnet.AnnotationEntity annotation, aim4_dotnet.User aimUserInfo) internal static string GetAimHtml(Aim4AnnotationInstance annotationInstance) { var annotation = annotationInstance == null ? null : annotationInstance.AimAnnotationEntity; if (annotation == null) { return(GetEmptyHtml()); } aim4_dotnet.User aimUserInfo = null; if (annotationInstance.ParentAimDocument is Aim4DocumentInstance) { aimUserInfo = ((Aim4DocumentInstance)annotationInstance.ParentAimDocument).AnnotationCollection.User; } if (annotation is aim4_dotnet.ImageAnnotation) { return(GetImageAnnotationHtml((aim4_dotnet.ImageAnnotation)annotation, aimUserInfo)); } if (annotation is aim4_dotnet.AnnotationOfAnnotation) { return(GetAnnotationOfAnnotationHtml((aim4_dotnet.AnnotationOfAnnotation)annotation, aimUserInfo)); } Platform.Log(LogLevel.Error, "Annotation Display Formatting (HTML): unknown annotation type"); Debug.Assert(false, "Uknown Annotation Type"); return("Unknown Annotation Type"); }
internal DataProvider(aim4_dotnet.AnnotationEntity annotation, aim4_dotnet.Person person, aim4_dotnet.User user) { Platform.CheckForNullReference(annotation, "Annotation"); _annotation = annotation; _person = person; _user = user; }
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 GetAnnotationOfAnnotationHtml(aim4_dotnet.AnnotationOfAnnotation annotationOfAnnotation, aim4_dotnet.User aimUserInfo) { throw new NotImplementedException(); }