Exemple #1
0
        private JCategoryItem createTabCategoryItem(string title, string pageCategory, string[] sTitle, string[] sPageCategory)
        {
            //Debuger.Assert(sTitle.Length == sPageCategory.Length);
            JCategoryItem categoryItem = new JCategoryItem();

            categoryItem.title = title;

            JCategory category = new JCategory();

            category.pageCategory      = pageCategory;
            category.homePageLeftTopic = title;

            categoryItem.category = category;

            if (sTitle != null && sTitle.Length > 0)
            {
                JCategory[] sCategory = new JCategory[sTitle.Length];
                for (int i = 0; i < sCategory.Length; i++)
                {
                    sCategory[i] = new JCategory();
                    sCategory[i].pageCategory      = sPageCategory[i];
                    sCategory[i].homePageLeftTopic = sTitle[i];
                }
                categoryItem.secondary = sCategory;
            }
            else
            {
                categoryItem.secondary = new JCategory[0];
            }

            return(categoryItem);
        }
    public static void Init(int col, int row)
    {
        Row      = row;
        Column   = col;
        Category = new List <JCategory>();
        Question = new List <List <JQuestion> >();

        DoubleCategory = new List <JCategory>();
        DoubleQuestion = new List <List <JQuestion> >();
        BlueTeam       = new List <string>();
        RedTeam        = new List <string>();
        FinalCategory  = new JCategory();
        FinalQuestion  = new JQuestion();

        for (int i = 0; i < Column; i++)
        {
            Category.Add(new JCategory());
            DoubleCategory.Add(new JCategory());
        }

        for (int i = 0; i < 10; i++)
        {
            RedTeam.Add("");
            BlueTeam.Add("");
        }

        for (int i = 0; i < Column; i++)
        {
            var qset = new List <JQuestion>();
            for (int j = 0; j < Row; j++)
            {
                qset.Add(new JQuestion());
            }
            Question.Add(qset);

            qset = new List <JQuestion>();
            for (int j = 0; j < Row; j++)
            {
                qset.Add(new JQuestion());
            }
            DoubleQuestion.Add(qset);
        }
    }