Пример #1
0
 public IEnumerable <object> Annotations(Type type)
 {
     if (type == typeof(ScopedNode))
     {
         return new[] { this }
     }
     ;
     else
     {
         return(Current.Annotations(type));
     }
 }
Пример #2
0
        private static ElementNode buildNode(ITypedElement node, bool recursive, IEnumerable <Type> annotationsToCopy, ElementNode parent)
        {
            var me = new ElementNode(node.Name, node.Value, node.InstanceType, node.Definition)
            {
                Parent = parent
            };

            foreach (var t in annotationsToCopy ?? Enumerable.Empty <Type>())
            {
                foreach (var ann in node.Annotations(t))
                {
                    me.AddAnnotation(ann);
                }
            }

            if (recursive)
            {
                me.ChildList.AddRange(node.Children().Select(c => buildNode(c, recursive: true, annotationsToCopy: annotationsToCopy, me)));
            }

            return(me);
        }
 IEnumerable <object> IAnnotated.Annotations(Type type) => Current.Annotations(type);
Пример #4
0
 IEnumerable <object> IAnnotated.Annotations(Type type)
 {
     return(type == typeof(TypedElementToSourceNodeAdapter) || type == typeof(ISourceNode) || type == typeof(IResourceTypeSupplier)
         ? (new[] { this })
         : Current.Annotations(type));
 }
 public virtual IEnumerable <object> Annotations(Type type) => Wrapped.Annotations(type);