Пример #1
0
        /// <summary>Finds and instantiates the specified document</summary>
        /// <param name="viewName">Name of the document to find</param>
        /// <param name="controllerName">Name of the controller that requested the document</param>
        /// <returns>Document result indicating the success of the operation</returns>
        public ViewEngineResult GetView(string viewName, string controllerName)
        {
            if (!viewName.StartsWith("CODEFrameworkStandardView"))
            {
                return new ViewEngineResult {
                           FoundView = false
                }
            }
            ;
            if (viewName.StartsWith("CODEFrameworkStandardViewNone"))
            {
                return new ViewEngineResult {
                           FoundView = false
                }
            }
            ;

            viewName = viewName.Replace("CODEFrameworkStandardView", string.Empty);

            var result = new ViewEngineResult();

            var view = new StandardViewGrid {
                ViewName = viewName
            };

            view.Children.Add(GetViewInternal(viewName));

            result.FoundView  = true;
            result.View       = view;
            result.ViewSource = "Standard Document: " + viewName;

            return(result);
        }
Пример #2
0
        /// <summary>Finds and instantiates the specified document</summary>
        /// <param name="viewName">Name of the document to find</param>
        /// <param name="controllerName">Name of the controller that requested the document</param>
        /// <returns>Document result indicating the success of the operation</returns>
        public ViewEngineResult GetView(string viewName, string controllerName)
        {
            if (!viewName.StartsWith("CODEFrameworkStandardView")) return new ViewEngineResult {FoundView = false};
            if (viewName.StartsWith("CODEFrameworkStandardViewNone")) return new ViewEngineResult {FoundView = false};

            viewName = viewName.Replace("CODEFrameworkStandardView", string.Empty);

            var result = new ViewEngineResult();

            var view = new StandardViewGrid {ViewName = viewName};
            view.Children.Add(GetViewInternal(viewName));

            result.FoundView = true;
            result.View = view;
            result.ViewSource = "Standard Document: " + viewName;

            return result;
        }