Ejemplo n.º 1
0
        /// <summary>
        /// Choose an IAnnotationComponent for a given IAttachedAnnotation.  Implementation in AnnotationComponentChooser knows
        /// about all out-of-box IAnnotationComponents.  The default mapping will be stated here later.
        /// Subclasses can overwrite this method to return application specific mapping.
        /// Note: In future release this method should be made virtual.
        /// </summary>
        /// <param name="attachedAnnotation">The IAttachedAnnotation that needs an IAnnotationComponent </param>
        /// <returns></returns>
        public IAnnotationComponent ChooseAnnotationComponent(IAttachedAnnotation attachedAnnotation)
        {
            if (attachedAnnotation == null)
            {
                throw new ArgumentNullException("attachedAnnotation");
            }

            IAnnotationComponent ac = null;

            // Text StickyNote
            if (attachedAnnotation.Annotation.AnnotationType == StickyNoteControl.TextSchemaName)
            {
                ac = new StickyNoteControl(StickyNoteType.Text) as IAnnotationComponent;
            }
            // Ink StickyNote
            else if (attachedAnnotation.Annotation.AnnotationType == StickyNoteControl.InkSchemaName)
            {
                ac = new StickyNoteControl(StickyNoteType.Ink) as IAnnotationComponent;
            }
            // Highlight
            else if (attachedAnnotation.Annotation.AnnotationType == HighlightComponent.TypeName)
            {
                ac = new HighlightComponent() as IAnnotationComponent;
            }

            return(ac);
        }
Ejemplo n.º 2
0
        // Token: 0x06006288 RID: 25224 RVA: 0x001BA5F8 File Offset: 0x001B87F8
        public IAnnotationComponent ChooseAnnotationComponent(IAttachedAnnotation attachedAnnotation)
        {
            if (attachedAnnotation == null)
            {
                throw new ArgumentNullException("attachedAnnotation");
            }
            IAnnotationComponent result = null;

            if (attachedAnnotation.Annotation.AnnotationType == StickyNoteControl.TextSchemaName)
            {
                result = new StickyNoteControl(StickyNoteType.Text);
            }
            else if (attachedAnnotation.Annotation.AnnotationType == StickyNoteControl.InkSchemaName)
            {
                result = new StickyNoteControl(StickyNoteType.Ink);
            }
            else if (attachedAnnotation.Annotation.AnnotationType == HighlightComponent.TypeName)
            {
                result = new HighlightComponent();
            }
            return(result);
        }