コード例 #1
0
ファイル: HomeController.cs プロジェクト: uan234G/StudyCards
        public IActionResult Chapter(int ChId)
        {
            NumList.Clear();
            Chapter CurrentChapter = dbContext.Chapters.Include(a => a.Book).Include(a => a.FlashCards).FirstOrDefault(a => a.ChapterId == ChId);

            ViewBag.ChapterId = CurrentChapter.ChapterId;
            return(View(CurrentChapter));
        }
コード例 #2
0
ファイル: World.cs プロジェクト: patrickHD/RPGConcept
        public void RemoveNum(Control control, bool removeAll)
        {
            Control    c = null;
            Object     x = null;
            bool       f1 = false, f2 = false;
            List <int> rmvList = new List <int>();

            if (removeAll == false)
            {
                NumList.Remove(control);
                BattleGrid.Children.Remove(control);
            }
            else
            {
                //foreach(object x in battleGrid.Children)
                for (int i = 0; i < BattleGrid.Children.Count; i++)
                {
                    if (BattleGrid.Children[i] is Control)
                    {
                        f1 = true;
                        c  = (Control)BattleGrid.Children[i];
                    }
                    if (c != null && c.Tag is ControlTag && (ControlTag)c.Tag == ControlTag.damagenum)
                    {
                        //rmvList.Add(i);
                        f2 = true;
                        BattleGrid.Children.Remove(c);
                    }
                }
                for (int j = 0; j < rmvList.Count; j++)
                {
                    //battleGrid.Children.RemoveAt(j);
                }
                for (int i = 0; i < NumList.Count; i++)
                {
                    NumList[i] = null;
                }
                if (f1 == f2 == true)
                {
                    BattleGrid.Children.Remove(BattleGrid.Children[BattleGrid.Children.Count - 1]);
                }
                NumList.Clear();
            }
        }