Esempio n. 1
0
        protected override DoNext performInvoke()
        {
            lock (_actionCall)
            {
                string output = _viewRenderder.RenderSparkView(
                    _viewToken, _actionCall, view =>
                {
                    var page = view as IFubuPage;
                    if (page != null)
                    {
                        page.ServiceLocator = _serviceLocator;
                    }

                    var viewWithModel = view as IFubuViewWithModel;
                    if (viewWithModel != null)
                    {
                        viewWithModel.SetModel(_request);
                    }
                });

                string contentType = MimeType.Html.ToString();

                if (_viewToken.MatchedDescriptor != null && _viewToken.MatchedDescriptor.Language == LanguageType.Javascript)
                {
                    contentType = MimeType.Javascript.ToString();
                }

                _writer.Write(contentType, output);
            }
            return(DoNext.Continue);
        }
Esempio n. 2
0
        protected override DoNext performInvoke()
        {
            lock (_actionCall)
            {
                var output = _viewRenderder.RenderSparkView(_viewToken, _actionCall, view => _activator.Activate(view));

                var contentType = MimeType.Html.ToString();

                if (_viewToken.MatchedDescriptor != null &&
                    _viewToken.MatchedDescriptor.Language == LanguageType.Javascript)
                {
                    contentType = MimeType.Javascript.ToString();
                }

                _writer.Write(contentType, output);
            }
            return(DoNext.Continue);
        }