本文整理汇总了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();
}
示例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();
}
示例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();
}