Exemplo n.º 1
0
        // Token: 0x06007C8C RID: 31884 RVA: 0x0023063C File Offset: 0x0022E83C
        private IAnnotationComponent FindComponent(IAttachedAnnotation attachedAnnotation)
        {
            UIElement d = attachedAnnotation.Parent as UIElement;
            AnnotationComponentChooser chooser = AnnotationService.GetChooser(d);

            return(chooser.ChooseAnnotationComponent(attachedAnnotation));
        }
Exemplo n.º 2
0
        /// <summary>
        /// given an attachedAnnotation find the chooser attached at its parent
        /// and ask it to choose a component suitable to handle the attachedAnnotation
        /// </summary>
        /// <param name="attachedAnnotation">the attachedAnnotation we are to find a component for</param>
        /// <returns>an IAnnotationComponent that can handle the attachedAnnotation (or null)</returns>
        private IAnnotationComponent FindComponent(IAttachedAnnotation attachedAnnotation)
        {
            Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null");

            UIElement annotatedElement = attachedAnnotation.Parent as UIElement; // casted from DependencyObject

            Debug.Assert(annotatedElement != null, "the annotatedElement should inherit from UIElement");

            AnnotationComponentChooser chooser = AnnotationService.GetChooser(annotatedElement);

            // should we return a list instead?
            IAnnotationComponent component = chooser.ChooseAnnotationComponent(attachedAnnotation);

            return(component);
        }