Пример #1
0
        public RootRenderer(RendererContext context, RenderState renderState)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (renderState == null)
            {
                throw new ArgumentNullException(nameof(renderState));
            }

            this.context     = context;
            this.renderState = renderState;

            itemStates = ImmutableList <ItemState> .Empty;
            document   = context.Document;

            var representedObject = renderState.Source as RepresentedObject;

            if (representedObject != null)
            {
                foreach (var result in representedObject)
                {
                    AppendSubrenderState(result);
                }
            }
            else
            {
                AppendSubrenderState(renderState.Source);
            }
        }
Пример #2
0
        internal RenderState With (RendererContext context, object source)
        {
            if (context == null)
                throw new ArgumentNullException (nameof (context));

            return new RenderState (
                context,
                ParentState,
                Source,
                source,
                cultureInfo,
                RemoteMember);
        }
Пример #3
0
 RenderState (
     RendererContext context,
     RenderState parentState,
     object originatingSource,
     object source,
     CultureInfo cultureInfo = null,
     RemoteMemberInfo remoteMemberInfo = null)
 {
     Context = context;
     ParentState = parentState;
     OriginatingSource = originatingSource;
     Source = source;
     this.cultureInfo = cultureInfo;
     RemoteMember = remoteMemberInfo;
 }