public static IndexController New(IControllable container, string typeName) { IndexController controller = null; using (LogGroup logGroup = LogGroup.StartDebug("Creating a new IndexController.")) { LogWriter.Debug("Type name: " + typeName); container.CheckCommand(); controller = ControllerState.Controllers.Creator.NewIndexer(typeName); controller.Container = container; controller.EnablePaging = false; if (QueryStrings.Available) { controller.CurrentPageIndex = QueryStrings.PageIndex; controller.SortExpression = QueryStrings.Sort; } } return(controller); }
/// <summary> /// Initializes the page and the controller for the specified type. /// </summary> /// <param name="type"></param> /// <param name="isPaged"></param> public void Initialize(Type type, bool isPaged) { Command = new IndexCommandInfo(type.Name); controller = IndexController.New(this); }
/// <summary> /// Initializes the page and the controller for the specified type. /// </summary> /// <param name="type"></param> /// <param name="isPaged"></param> public void Initialize(Type type, IndexGrid indexGrid, bool isPaged) { Command = new IndexCommandInfo(type.Name); Grid = indexGrid; controller = IndexController.New(this, new PagingLocation(Grid.CurrentPageIndex, Grid.PageSize)); Grid.SortCommand += new DataGridSortCommandEventHandler(Grid_SortCommand); Grid.PageIndexChanged += new DataGridPageChangedEventHandler(Grid_PageIndexChanged); SortExpression = indexGrid.CurrentSort; }