Пример #1
0
        public void Write(IProjectionContext <TParent> context, IMediaNode node)
        {
            var value = context.ValueFor(_accessor);

            if (value != null)
            {
                _projector.Project(AttributeName, (T)value, node);
            }
        }
Пример #2
0
        void IProjection <TParent> .Write(IProjectionContext <TParent> context, IMediaNode node)
        {
            var value = context.ValueFor(_accessor) as TChild;

            if (value == null)
            {
                return;
            }

            var childNode = node.AddChild(_name);

            var childContext = context.ContextFor(value);

            write(childContext, childNode);
        }
 public static string FormattedValueOf <T>(this IProjectionContext <T> context, Accessor accessor)
 {
     return(context.Formatter.GetDisplayForValue(accessor, context.ValueFor(accessor)));
 }