Пример #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);
 }