예제 #1
0
        public void InitSelection()
        {
            if (Kind == "UI")
            {
                WithFooter = false;
            }

            if (SinglePage)
            {
                UseChangedPageHandler = false;
                HandleErrors          = false;
            }

            ColorOdd = ColorEven;
            List     = new List <ListItem <string> >();
            Choices.ForEach(choice => List.Add(new ListItem <string>(choice)));
            Action       = PaginationAction(new ItemListing <ListItem <string> >(DisplayAction));
            ListCount    = Choices.Count;
            ItemsPerPage = 8;
            ExitMessage  = null;

            InitEventAction        = new ItemListing <ListItem <string> >(InitEvent);
            DeconstructEventAction = new ItemListing <ListItem <string> >(DeconstructEvent);
            InitListItem           = new InitListing <ListItem <string> >(InitListItemAction);
            DefaultKeyPressSub     = DefaultKeyPressSubAction;

            DefaultKeyPress = new DefaultKeyPress(DefaultKeyPressAction);
            if (UseChangedPageHandler)
            {
                PageChanged += new Action(ChangePageHandler);
            }
            PaginationExited += new Action(() => EventDestructor(0, List.Count - 1));

            Utils.Cconsole.Color(LabelColor).WriteLine(Label);
            CursorTop = Console.CursorTop;

            Paginate();
        }