示例#1
0
        public bool Init(InitCondition Condition)
        {
            CurrentFace = Faces.QuestionFace;
            bool is_ok = CheckCardsFolder();

            if (is_ok == false)
            {
                MessageBox.Show("Initialization failed");
            }

            switch (Condition)
            {
            case InitCondition.AllCards:
                this.Cards = Globals.GetListOfCards(Globals.GetPathOfEachCard());
                break;

            case InitCondition.PendingCards:
                this.Cards = Globals.GetListOfCards(Globals.GetPathOfEachPendingCard());
                break;

            case InitCondition.MissedCards:
                this.Cards = Globals.GetListOfCards(Globals.GetPathOfEachMissedCard());
                break;

            case InitCondition.SingleSpecifiedCard:
                this.Cards = Globals.GetListOfCards(new string[] { this.SingleSpecifiedCardFolder });
                break;
            }
            this.CurrentCardIndex = 0;
            Present();
            return(is_ok);
        }
示例#2
0
 internal static int GetNumberOfMissedCards()
 {
     string[] missed_cards = Globals.GetPathOfEachMissedCard();
     if (missed_cards == null)
     {
         return(0);
     }
     return(missed_cards.Length);
 }
示例#3
0
        void PresentMissedCards(string CardGroupPath)
        {
            string[] paths = null;
            if (CardGroupPath == "[ALL]")
            {
                paths = Globals.GetPathOfEachMissedCard();
            }
            else
            {
                paths = Globals.GetPathOfEachMissedCard(CardGroupPath);
            }

            var             cards = Globals.GetListOfCards(paths);
            CtrlCardBrowser cb    = new CtrlCardBrowser();

            cb.Init(cards);

            wndMainWindow.PresentContent(cb);
        }
示例#4
0
        private static string GetButtonsForMissedCards(string CardGroup)
        {
            string buttons = "";

            string[] missed_cards = Globals.GetPathOfEachMissedCard(CardGroup);
            if (missed_cards == null)
            {
                return("");
            }
            var cards = Globals.GetListOfCards(missed_cards);

            foreach (Card card in cards)
            {
                string btn_text = Globals.GetLastPartOfDir(card.CardAbsPath);
                string href     = string.Format("{0}/Q.html", btn_text);
                buttons += GetButton(btn_text, 200, 30, href);
                buttons += "<br />";
                buttons += "\r\n";
            }
            return(buttons);
        }
示例#5
0
 internal static int GetNumberOfMissedCards(string GroupPath)
 {
     return(Globals.GetPathOfEachMissedCard(GroupPath).Length);
 }