public static ViewResult WithoutModel <TView>(this ViewResultBuilder <TView> vb) where TView : System.Web.Mvc.WebViewPage { return(new ViewResult { ViewName = typeof(TView).AssemblyQualifiedName }); }
public static ViewResult WithModel <TView, TModel>(this ViewResultBuilder <TView> vb, TModel model) where TView : System.Web.Mvc.WebViewPage <TModel> { return(new ViewResult { ViewName = typeof(TView).AssemblyQualifiedName, ViewData = new ViewDataDictionary <TModel>(model) }); }
public IView GetView(string view, string keyword) { IView result; ViewResult viewResult = ViewResultBuilder.BuildResult(dataset, view, keyword); switch (viewResult.Name) { case "unassigned": result = new View(viewResult.Result) { Foreground = ConsoleColor.DarkRed, Background = ConsoleColor.Black }; break; case "assigned-ready": result = new View(viewResult.Result) { Foreground = ConsoleColor.DarkYellow, Background = ConsoleColor.Black }; break; case "complete": result = new View(viewResult.Result) { Foreground = ConsoleColor.Green, Background = ConsoleColor.Black }; break; case "priority-1-unassigned": result = new View(viewResult.Result) { Foreground = ConsoleColor.Red, Background = ConsoleColor.Black }; break; case "priority-2-unassigned": result = new View(viewResult.Result) { Foreground = ConsoleColor.Red, Background = ConsoleColor.Black }; break; default: throw new InvalidOperationException($"View {view} specified is not supported"); } return(result); }
private void ShowSelectedView() { viewModel.SetViewResult(ViewResultBuilder.BuildResult(currentDataSet, viewModel.CurrentViewType, context.Keyword)); }