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; }
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; }
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); }
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; }
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); }
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); }
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)); }
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); }
public static void AddView(this IOutputNode node, IViewToken token) { var writer = typeof(ViewWriter <>).CloseAndBuildAs <IMediaWriter>(token, node.ResourceType); node.Add(writer); }
public static void AddView(this IOutputNode node, IViewToken token, IConditional conditional) { var writer = typeof(ViewWriter <>).CloseAndBuildAs <object>(token, node.ResourceType); node.Add(writer, conditional); }