Example #1
0
        protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings)
        {
            node.Add(settings.FormatterFor(MimeType.Json));
            node.Add(settings.FormatterFor(MimeType.Xml));

            return(DoNext.Continue);
        }
        protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings)
        {
            node.Add(settings.FormatterFor(MimeType.Json));
            node.Add(settings.FormatterFor(MimeType.Xml));

            return DoNext.Continue;
        }
        protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings)
        {
            var graph = settings.Graph ?? new ConnegGraph();
            graph.WriterTypesFor(node.ResourceType).Each(type => node.Add((IMediaWriter) Activator.CreateInstance(type)));

            return DoNext.Continue;
        }
Example #4
0
        protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings)
        {
            var graph = settings.Graph ?? new ConnegGraph();

            graph.WriterTypesFor(node.ResourceType).Each(type => node.Add((IMediaWriter)Activator.CreateInstance(type)));

            return(DoNext.Continue);
        }
        protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings)
        {
            if (!chain.ResourceType().CanBeCastTo<AjaxContinuation>()) return DoNext.Continue;
       
            node.Add(typeof(AjaxContinuationWriter<>));

            return DoNext.Stop;
        }
Example #6
0
        protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings)
        {
            if (chain.ResourceType().CanBeCastTo <HtmlTag>() || chain.ResourceType().CanBeCastTo <HtmlDocument>())
            {
                node.Add(typeof(HtmlStringWriter <>));
                return(DoNext.Stop);
            }

            return(DoNext.Continue);
        }
Example #7
0
        protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings)
        {
            if (chain.ResourceType().CanBeCastTo<HtmlTag>() || chain.ResourceType().CanBeCastTo<HtmlDocument>())
            {
                node.Add(typeof(HtmlStringWriter<>));
                return DoNext.Stop;
            }

            return DoNext.Continue;
        }
Example #8
0
        protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings)
        {
            if (chain.ResourceType() == typeof (string))
            {
                node.Add(new StringWriter());

                return DoNext.Stop;
            }

            return base.applyOutputs(node, chain, settings);
        }
Example #9
0
        protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings)
        {
            if (chain.AnyActionHasAttribute <AsymmetricJsonAttribute>() || chain.ResourceType().CanBeCastTo <IDictionary <string, object> >())
            {
                node.Add(settings.FormatterFor(MimeType.Json));

                return(DoNext.Stop);
            }

            return(DoNext.Continue);
        }
Example #10
0
        protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings)
        {
            if (chain.ResourceType() == typeof(string))
            {
                node.Add(new StringWriter());

                return(DoNext.Stop);
            }

            return(base.applyOutputs(node, chain, settings));
        }
Example #11
0
        protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings)
        {
            if (!chain.ResourceType().CanBeCastTo <AjaxContinuation>())
            {
                return(DoNext.Continue);
            }

            node.Add(typeof(AjaxContinuationWriter <>));

            return(DoNext.Stop);
        }
Example #12
0
        public static void AddView(this IOutputNode node, IViewToken token)
        {
            var writer = typeof(ViewWriter <>).CloseAndBuildAs <IMediaWriter>(token, node.ResourceType);

            node.Add(writer);
        }
Example #13
0
        public static void AddView(this IOutputNode node, IViewToken token, IConditional conditional)
        {
            var writer = typeof(ViewWriter <>).CloseAndBuildAs <object>(token, node.ResourceType);

            node.Add(writer, conditional);
        }