当前位置: 首页>>代码示例>>C#>>正文


C# Node.ExpandAll方法代码示例

本文整理汇总了C#中DevComponents.AdvTree.Node.ExpandAll方法的典型用法代码示例。如果您正苦于以下问题:C# Node.ExpandAll方法的具体用法?C# Node.ExpandAll怎么用?C# Node.ExpandAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DevComponents.AdvTree.Node的用法示例。


在下文中一共展示了Node.ExpandAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RefreshByTotalHour

        /// <summary>
        /// 根據總時數更新班級列表,同時考量到關鍵字搜尋
        /// </summary>
        private void RefreshByTotalHour(string idWhom)
        {
            int Total = 0;

            //根據分課的總時數進行分類
            SortedDictionary<int, List<string>> TotalWhoms = new SortedDictionary<int, List<string>>();

            foreach (Class Whom in schLocal.Classes)
            {
                if (Whom.Name.Equals("無"))
                    continue;

                int TotalHour = Whom.TotalHour;

                if (!TotalWhoms.ContainsKey(TotalHour))
                    TotalWhoms.Add(TotalHour, new List<string>());

                if (IsAddWhom(Whom.Name))
                    if (!TotalWhoms[TotalHour].Contains(Whom.ClassID))
                        TotalWhoms[TotalHour].Add(Whom.ClassID);
            }

            nodeTree.Nodes.Clear();

            Node nodeRoot = new Node("所有班級");
            nodeRoot.TagString = "所有班級";

            Node nodeNull = new Node("無班級");
            nodeNull.TagString = "無";

            nodeTree.Nodes.Add(nodeRoot);
            nodeTree.Nodes.Add(nodeNull);

            foreach (int vTotalHour in TotalWhoms.Keys.ToList().OrderByDescending(x => x))
            {
                Node nodeTotalHour = new Node("" + vTotalHour);
                List<string> Names = new List<string>();

                foreach (string vWhomID in TotalWhoms[vTotalHour])
                {
                    if (schLocal.Classes.Exists(vWhomID))
                    {
                        Class whomPaint = schLocal.Classes[vWhomID];

                        if (whomPaint.TotalHour > 0)
                        {
                            int UnAllocHour = whomPaint.TotalHour - whomPaint.AllocHour;

                            Node nodeWhom = new Node(whomPaint.Name + "(" + UnAllocHour + "/" + whomPaint.TotalHour + ")");
                            nodeWhom.TagString = whomPaint.ClassID;
                            Names.Add(whomPaint.ClassID);
                            nodeTotalHour.Nodes.Add(nodeWhom);
                            Total++;
                        }
                    }
                }

                if (nodeTotalHour.Nodes.Count > 0)
                {
                    nodeTotalHour.Text = nodeTotalHour.Text + "(" + nodeTotalHour.Nodes.Count + ")";
                    nodeTotalHour.TagString = string.Join(";", Names.ToArray());
                    nodeRoot.Nodes.Add(nodeTotalHour);
                    nodeRoot.Expand();
                }
            }

            nodeRoot.Text = nodeRoot.Text + "(" + schLocal.Classes.HasTotalHourCount + ")";
            nodeRoot.ExpandAll();
        }
开发者ID:KunHsiang,项目名称:ischedule,代码行数:72,代码来源:usrClassList.cs

示例2: RefreshByUnAlloc

        /// <summary>
        /// 根據未排時數更新班級列表,同時考量到關鍵字搜尋
        /// </summary>
        private void RefreshByUnAlloc(string idWho)
        {
            int Total = 0;

            //根據分課的未排時數進行分類
            SortedDictionary<int, List<string>> UnAllocWhos = new SortedDictionary<int, List<string>>();

            foreach (Class Whom in schLocal.Classes)
            {
                if (Whom.Name.Equals("無"))
                    continue;

                int UnAlloc = Whom.TotalHour - Whom.AllocHour;

                //若未排時數不在字典中則新增
                if (!UnAllocWhos.ContainsKey(UnAlloc))
                    UnAllocWhos.Add(UnAlloc, new List<string>());

                if (IsAddWhom(Whom.ClassID))
                    if (!UnAllocWhos[UnAlloc].Contains(Whom.ClassID))
                        UnAllocWhos[UnAlloc].Add(Whom.ClassID);
            }

            nodeTree.Nodes.Clear();

            Node nodeRoot = new Node("所有班級");
            nodeRoot.TagString = "所有班級";

            Node nodeNull = new Node("無班級");
            nodeNull.TagString = "無";

            nodeTree.Nodes.Add(nodeRoot);
            nodeTree.Nodes.Add(nodeNull);

            foreach (int vUnAlloc in UnAllocWhos.Keys.ToList().OrderByDescending(x => x))
            {
                Node UnAlloc = new Node("" + vUnAlloc);
                List<string> Names = new List<string>();

                foreach (string vWhomID in UnAllocWhos[vUnAlloc])
                {
                    if (schLocal.Classes.Exists(vWhomID))
                    {
                        Class whomPaint = schLocal.Classes[vWhomID];

                        if (whomPaint.TotalHour > 0)
                        {
                            int UnAllocHour = whomPaint.TotalHour - whomPaint.AllocHour;

                            Node nodeWhom = new Node(whomPaint.Name + "(" + UnAllocHour + "/" + whomPaint.TotalHour + ")");
                            nodeWhom.TagString = whomPaint.ClassID;
                            Names.Add(whomPaint.ClassID);
                            UnAlloc.Nodes.Add(nodeWhom);
                            Total++;
                        }
                    }
                }

                if (UnAlloc.Nodes.Count > 0)
                {
                    UnAlloc.Text = UnAlloc.Text + "(" + UnAlloc.Nodes.Count + ")";
                    UnAlloc.TagString = string.Join(";", Names.ToArray());
                    nodeRoot.Nodes.Add(UnAlloc);
                    nodeRoot.Expand();
                }
            }

            nodeRoot.Text = nodeRoot.Text + "(" + schLocal.Classes.HasTotalHourCount + ")";
            nodeRoot.ExpandAll();
        }
开发者ID:KunHsiang,项目名称:ischedule,代码行数:73,代码来源:usrClassList.cs

示例3: GradeYear

        /// <summary>
        /// 根據年級更新班級表,同時考量到關鍵字搜尋
        /// </summary>
        private void GradeYear(string idWhom)
        {
            int Total = 0;

            //根據分課的年級進行分類
            SortedDictionary<string, List<string>> GradeYearWhoms = new SortedDictionary<string, List<string>>();

            foreach (Class vWhom in schLocal.Classes)
            {
                //取得年級
                string GradeYear = vWhom.GradeYear;

                //若年級名稱不在字典中則新增
                if (!GradeYearWhoms.ContainsKey(GradeYear))
                    GradeYearWhoms.Add(GradeYear, new List<string>());

                if (IsAddWhom(vWhom.ClassID))
                    if (!GradeYearWhoms[GradeYear].Contains(vWhom.ClassID))
                        GradeYearWhoms[GradeYear].Add(vWhom.ClassID);
            }

            nodeTree.Nodes.Clear();

            Node nodeRoot = new Node("所有年級");
            nodeRoot.TagString = "所有年級";
            Node nodeNull = new Node("無班級");
            nodeNull.TagString = "無";

            nodeTree.Nodes.Add(nodeRoot);
            nodeTree.Nodes.Add(nodeNull);

            foreach (string GradeYear in GradeYearWhoms.Keys)
            {
                Node nodeGradeYear = new Node(GradeYear);
                List<string> Names = new List<string>();

                foreach (string WhomID in GradeYearWhoms[GradeYear])
                {
                    if (schLocal.Classes.Exists(WhomID))
                    {
                        Class whomPaint = schLocal.Classes[WhomID];

                        if (whomPaint.TotalHour > 0)
                        {
                            int UnAllocHour = whomPaint.TotalHour - whomPaint.AllocHour;

                            Node nodeWho = new Node(whomPaint.Name + "(" + UnAllocHour + "/" + whomPaint.TotalHour + ")");
                            nodeWho.TagString = whomPaint.ClassID;
                            nodeGradeYear.Nodes.Add(nodeWho);
                            Names.Add(whomPaint.ClassID);
                            Total++;
                        }
                    }
                }

                if (nodeGradeYear.Nodes.Count > 0)
                {
                    nodeGradeYear.Text = nodeGradeYear.Text + "(" + nodeGradeYear.Nodes.Count + ")";
                    nodeGradeYear.TagString = string.Join(";", Names.ToArray());
                    nodeRoot.Nodes.Add(nodeGradeYear);
                    nodeRoot.Expand();
                }
            }

            nodeRoot.Text = nodeRoot.Text + "(" + schLocal.Classes.HasTotalHourCount + ")";
            nodeRoot.ExpandAll();
        }
开发者ID:KunHsiang,项目名称:ischedule,代码行数:70,代码来源:usrClassList.cs


注:本文中的DevComponents.AdvTree.Node.ExpandAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。