本文整理汇总了C#中DevComponents.AdvTree.Node.Expand方法的典型用法代码示例。如果您正苦于以下问题:C# Node.Expand方法的具体用法?C# Node.Expand怎么用?C# Node.Expand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevComponents.AdvTree.Node
的用法示例。
在下文中一共展示了Node.Expand方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: RefreshBySchool
/// <summary>
/// 根據學校更新班級列表,同時考量到關鍵字搜尋
/// </summary>
private void RefreshBySchool(string idWhom)
{
int Total = 0;
//根據分課的總時數進行分類
SortedDictionary<string, List<string>> TotalClasses = new SortedDictionary<string, List<string>>();
foreach (Class Class in schLocal.Classes)
{
if (Class.Name.Equals("無"))
continue;
string[] ClassIDs = Class.ClassID.Split(new char[] { ',' });
string DSNS = ClassIDs[0];
string SchoolName = DSNS;
if (Global.AvailDSNSNames != null)
{
SchoolDSNSName School = Global.AvailDSNSNames
.Find(x => x.DSNSName.Equals(DSNS));
if (School != null)
SchoolName = School.SchoolName;
}
if (!TotalClasses.ContainsKey(SchoolName))
TotalClasses.Add(SchoolName, new List<string>());
if (IsAddWhom(Class.Name))
if (!TotalClasses[SchoolName].Contains(Class.ClassID))
TotalClasses[SchoolName].Add(Class.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 School in TotalClasses.Keys.ToList().OrderByDescending(x => x))
{
Node nodeTotalHour = new Node("" + School);
List<string> Names = new List<string>();
TotalClasses[School].Sort();
foreach (string vWhomID in TotalClasses[School])
{
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());
nodeTotalHour.Expand();
nodeTree.Nodes.Add(nodeTotalHour);
//nodeRoot.Nodes.Add(nodeTotalHour);
//nodeRoot.Expand();
}
}
//nodeRoot.Text = nodeRoot.Text + "(" + schLocal.Classes.HasTotalHourCount + ")";
//nodeRoot.ExpandAll();
}
示例4: RefreshByName
/// <summary>
/// 根據班級名稱更新班級列表,同時考量到關鍵字搜尋
/// </summary>
private void RefreshByName(string idWhom)
{
//根據分課的名稱進行分類
SortedDictionary<string, string> Names = new SortedDictionary<string, string>();
foreach (Class Whom in schLocal.Classes)
{
int TotalHour = Whom.TotalHour;
//若班級名稱不在字典中則新增
if (!Names.ContainsKey(Whom.Name))
Names.Add(Whom.Name,Whom.ClassID);
}
nodeTree.Nodes.Clear();
Node nodeAll = new Node("所有班級");
nodeAll.TagString = "所有班級";
Node nodeNull = new Node("無班級");
nodeNull.TagString = "無";
nodeTree.Nodes.Add(nodeAll);
nodeTree.Nodes.Add(nodeNull);
foreach (string WhomName in Names.Keys)
{
if (WhomName.Equals("無"))
continue;
if (IsAddWhom(WhomName))
{
Class whomPaint = schLocal.Classes[Names[WhomName]];
if (whomPaint.TotalHour > 0)
{
int UnAllocHour = whomPaint.TotalHour - whomPaint.AllocHour;
Node nodeWhom = new Node(whomPaint.Name + "(" + UnAllocHour + "/" + whomPaint.TotalHour + ")");
nodeWhom.TagString = whomPaint.ClassID;
nodeAll.Nodes.Add(nodeWhom);
}
}
}
nodeAll.Text = nodeAll.Text + "(" + schLocal.Classes.HasTotalHourCount + ")";
nodeAll.Expand();
}
示例5: 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();
}
示例6: DoLockerTreetry
// Used to convert wtl -> xml locker
public void DoLockerTreetry(string InputFile)
{
LockerTreetry2.Nodes.Clear();
//Ini.IniFile Locker = new Ini.IniFile(InputFile);
//XmlFile Locker = new XmlFile(InputFile);
//OpenedLocker = InputFile;
// rootnode
Node ndroot = new Node();
ndroot.Text = "INI";
ndroot.Expand();
LockerTreetry2.Nodes.Add(ndroot);
Node[] ndparts = new Node[19];
string[] strParts = new string[19];
int[] ndcntparts = new int[19];
bool bFound;
//Build tree
// read file (default.wtl) to stringarray
string[] strRead = new string[19];
string line;
int count = 0;
// Read the file and display it line by line.
System.IO.StreamReader file = new System.IO.StreamReader(InputFile);
while ((line = file.ReadLine()) != null)
{
// Section
if (line.Length > 0) // no empty lines
{
if (line.StartsWith("[") && line.EndsWith("]"))
{
strRead[15] = line.Substring(1, line.Length - 2);
if (strRead[15].Contains(" (Copy"))
strRead[15] = strRead[15].Remove(strRead[15].IndexOf(" (Copy"));
count = 0;
}
if (line.Contains("Type="))
{
strRead[0] = line.Substring(line.IndexOf("=") + 1);
count++;
}
if (line.Contains("Rating="))
{
strRead[16] = line.Substring(line.IndexOf("=") + 1);
count++;
}
if (line.Contains("Description="))
{
strRead[17] = line.Substring(line.IndexOf("=") + 1);
count++;
}
for (int partindex = 1; partindex < 15; partindex++)
{
if (line.Contains("Part" + partindex + "="))
{
strRead[partindex] = line.Substring(line.IndexOf("=") + 1);
count++;
}
}
if (count == 17)
{
count = 0;
for (int partindex = 0; partindex < 1; partindex++)
{
// All sections
// read the ini values
bFound = false;
ndparts[partindex] = null;
strParts[partindex] = null;
//read type
strParts[partindex] = strRead[partindex];
for (int ndcnt = 0; ndcnt < ndroot.Nodes.Count; ndcnt++)
{
if (ndroot.Nodes[ndcnt].Text == strParts[partindex])
{
bFound = true;
ndparts[partindex] = ndroot.Nodes[ndcnt];
break;
}
}
if (!bFound)
{
ndparts[partindex] = new Node();
ndparts[partindex].Text = strParts[partindex];
ndparts[partindex].Expand();
ndroot.Nodes.Add(ndparts[partindex]);
}
}
//.........这里部分代码省略.........
示例7: DoLockerTreeNodupe
// Clear out weapon/itemdupes by splitting them to their parts and add all to a tree
// Clear out namedupes too (renaming to (Copy x)
public void DoLockerTreeNodupe(string InputFile)
{
LockerTreetry2.Nodes.Clear();
//Ini.IniFile Locker = new Ini.IniFile(InputFile);
//XmlFile Locker = new XmlFile(InputFile);
//OpenedLocker = InputFile;
// rootnode
Node ndroot = new Node();
ndroot.Text = "INI";
ndroot.Expand();
LockerTreetry2.Nodes.Add(ndroot);
XmlDocument xmlrdrdoc = new XmlDocument();
xmlrdrdoc.Load(InputFile);
// get a list of all items
XmlNodeList xnrdrList = xmlrdrdoc.SelectNodes("/INI/Section");
foreach (XmlNode xn in xnrdrList)
{
//xn.Value
//temp = xn.InnerText.ToString();
//Console.WriteLine(xn.InnerText);
Node ndparent = ndroot;
Node ndchild = null;
bool bFound;
string[] strParts = new string[]
{
xn["Type"].InnerText,
xn["Part1"].InnerText,
xn["Part2"].InnerText,
xn["Part3"].InnerText,
xn["Part4"].InnerText,
xn["Part5"].InnerText,
xn["Part6"].InnerText,
xn["Part7"].InnerText,
xn["Part8"].InnerText,
xn["Part9"].InnerText,
xn["Part10"].InnerText,
xn["Part11"].InnerText,
xn["Part12"].InnerText,
xn["Part13"].InnerText,
xn["Part14"].InnerText,
xn["Name"].InnerText,
xn["Rating"].InnerText,
xn["Description"].InnerText,
//"0", "5", "63"
xn["RemAmmo_Quantity"].InnerText,
xn["Quality"].InnerText,
xn["Level"].InnerText
};
//xn.Attributes["Name"].Value };
if (strParts[15].Contains(" (Copy"))
strParts[15] = strParts[15].Remove(strParts[15].IndexOf(" (Copy"));
string itemtypeprefixget = "";
string itemtypeprefixgetsc = "";
if (strParts[0] == "Item")
{
//Type in Part2 -> strParts[2]
itemtypeprefixget = GetName(TitlesXml, strParts, 2, "Prefix");
if (itemtypeprefixget.Length == 0)
{
// Create a Section with the default prefix
string itemtypeprefix = strParts[2].Substring(strParts[2].LastIndexOf(".") + 1);
itemtypeprefix = itemtypeprefix.Substring(itemtypeprefix.IndexOf("_") + 1);
TitlesXml.XmlWriteValue(strParts[2], "Prefix", itemtypeprefix);
itemtypeprefixget = itemtypeprefix;
}
itemtypeprefixget += " "; // Add trailing space
if (!strParts[15].StartsWith(itemtypeprefixget + itemtypeprefixgetsc) && itemtypeprefixget.Length > 1)
{
strParts[15] = itemtypeprefixget + itemtypeprefixgetsc + GetName(TitlesXml, strParts, 8, "PartName");
if (strParts[15].EndsWith(" "))
strParts[15] = strParts[15] + GetName(TitlesXml, strParts, 9, "PartName");
else
strParts[15] = strParts[15] + ' ' + GetName(TitlesXml, strParts, 9, "PartName");
}
}
else if (strParts[0] == "Weapon")
{
//Type in Part1 -> strParts[1]
itemtypeprefixget = GetName(TitlesXml, strParts, 1, "Prefix");
if (itemtypeprefixget.Length == 0)
{
string itemtypeprefix = strParts[1].Substring(strParts[1].LastIndexOf(".") + 1);
itemtypeprefix = itemtypeprefix.Substring(itemtypeprefix.IndexOf("_") + 1);
if (itemtypeprefix.StartsWith("Weapon_"))
itemtypeprefix = itemtypeprefix.Substring(7);
TitlesXml.XmlWriteValue(strParts[1], "Prefix", itemtypeprefix);
itemtypeprefixget = itemtypeprefix;
}
//.........这里部分代码省略.........