コード例 #1
0
    public void GoTo(ViewPages viewPages, NameValueCollection parameters)
    {
        HttpContext currentContext = HttpContext.Current;
            string redirectUrl = string.Empty;

            switch (viewPages)
            {
                case ViewPages.Eventos:
                    redirectUrl = "~/ListaEventos.aspx";
                    break;
                case ViewPages.EventoDetalles:
                    redirectUrl = "~/Evento.aspx";
                    break;
                case ViewPages.Confirmacion:
                    redirectUrl = "~/Confirmacion.aspx";
                    break;
                case ViewPages.Error:
                    redirectUrl = "~/Erroaspx";
                    break;
                default:
                    throw new ArgumentOutOfRangeException("viewPages");
            }

            currentContext.Response.Redirect(redirectUrl, true);
    }
コード例 #2
0
        /// <summary>
        /// Set the active view
        /// </summary>
        /// <param name="view"></param>
        public void SetView(ViewPages view)
        {
            var currentView = (int)View;

            _views[(ViewPages)currentView].Deactivate();
            View = view;
        }
コード例 #3
0
 public ViewManager(ViewContext viewContext, ViewPages defaultView)
 {
     _viewContext = viewContext;
     View         = defaultView;
     // this does not define the order, ViewPages does
     _views.Add(ViewPages.ActiveTests, new ActiveTestsView());
     _views.Add(ViewPages.Errors, new ErrorsView());
     _views.Add(ViewPages.RunStatus, new RunStatusView());
     _views.Add(ViewPages.ReportPreview, new ReportPreviewView());
 }
コード例 #4
0
 public void GoTo(ViewPages viewPages)
 {
     GoTo(viewPages, null);
 }
コード例 #5
0
 public void SetView(ViewPages view)
 {
     _viewManager?.SetView(view);
 }