Exemple #1
0
 internal AnnotationVisual GetAnnotationVisual(AnnotationSceneNode annotation)
 {
     AnnotationEditor.AnnotationInfo annotationInfo = this.annotationSub.FindPathNode((SceneNode)annotation).Info;
     if (annotationInfo != null)
     {
         return(annotationInfo.Visual);
     }
     return(Enumerable.FirstOrDefault <AnnotationVisual>(Enumerable.OfType <AnnotationVisual>((IEnumerable)this.sceneViewModel.DefaultView.Artboard.AnnotationLayer.Children), (Func <AnnotationVisual, bool>)(visual => visual.Annotation == annotation)));
 }
Exemple #2
0
 private void Annotation_Changed(object sender, SceneNode pathNode, AnnotationEditor.AnnotationInfo info, DocumentNodeMarker damageMarker, DocumentNodeChange damage)
 {
     this.AnnotationService.OnAnnotationChanged(info.Annotation);
     if (damage.IsPropertyChange)
     {
         if (damage.PropertyKey.Equals((object)AnnotationSceneNode.IdProperty))
         {
             this.RecomputeCachedAnnotationReferences(((DocumentPrimitiveNode)damage.OldChildNode).GetValue <string>(), ((DocumentPrimitiveNode)damage.NewChildNode).GetValue <string>());
         }
         if (info.Visual != null)
         {
             info.Visual.ViewModel.RefreshProperty(damage.PropertyKey.Name);
         }
     }
     this.InvalidateAdorners(info.Annotation, false);
 }
Exemple #3
0
 private void Annotation_Removed(object sender, SceneNode basisNode, object basisContent, SceneNode oldPathNode, AnnotationEditor.AnnotationInfo info)
 {
     this.AnnotationService.OnAnnotationDeleted(info.Annotation);
     this.RecomputeCachedAnnotationReferences(info.Annotation.Id);
     this.InvalidateAdorners(info.Annotation, true);
     this.InvalidateAdorners(info.AnnotationOwner);
     if (info.Visual == null || info.Visual.Annotation.IsInDocument)
     {
         return;
     }
     this.AnnotationLayer.Children.Remove((UIElement)info.Visual);
 }
Exemple #4
0
 private void Annotation_Inserted(object sender, SceneNode basisNode, object basisContent, SceneNode newPathNode, AnnotationEditor.AnnotationInfo info)
 {
     info.Visual            = this.CreateAnnotationVisual(info.Annotation);
     info.Visual.Visibility = Visibility.Visible;
     this.AnnotationService.OnAnnotationAdded(info.Annotation);
     this.RecomputeCachedAnnotationReferences(info.Annotation.Id);
     this.InvalidateAdorners(info.Annotation, true);
 }