Example #1
0
        public static void CloneAnnotation(AnnotationSceneNode annotationNode, SceneNode newParent)
        {
            DocumentNode        node = annotationNode.DocumentNode.Clone(newParent.DocumentContext);
            AnnotationSceneNode annotationSceneNode = (AnnotationSceneNode)newParent.ViewModel.GetSceneNode(node);

            AnnotationManagerSceneNode.GetAnnotations(newParent).Add(annotationSceneNode);
        }
Example #2
0
 public static void SetAnnotationParent(AnnotationSceneNode annotationNode, SceneNode newParent)
 {
     if (annotationNode.Parent != null)
     {
         AnnotationManagerSceneNode.DeleteAnnotation(annotationNode);
     }
     AnnotationManagerSceneNode.GetAnnotations(newParent).Add(annotationNode);
 }
Example #3
0
        public static AnnotationSceneNode CreateAnnotation(SceneNode ownerNode)
        {
            if (ownerNode == null)
            {
                throw new ArgumentNullException("ownerNode");
            }
            AnnotationSceneNode annotationNode = AnnotationSceneNode.Factory.Instantiate(ownerNode.ViewModel);

            annotationNode.Timestamp = DateTime.UtcNow;
            AnnotationManagerSceneNode.SetAnnotationParent(annotationNode, ownerNode);
            return(annotationNode);
        }
Example #4
0
        public static void DeleteAnnotation(AnnotationSceneNode nodeToRemove)
        {
            SceneNode parent = nodeToRemove.Parent;
            IList <AnnotationSceneNode> annotations = AnnotationManagerSceneNode.GetAnnotations(parent);

            annotations.Remove(nodeToRemove);
            if (annotations.Count != 0)
            {
                return;
            }
            parent.ClearLocalValue(AnnotationManagerSceneNode.AnnotationsProperty);
        }