本文整理汇总了C#中Tree.BuildTree方法的典型用法代码示例。如果您正苦于以下问题:C# Tree.BuildTree方法的具体用法?C# Tree.BuildTree怎么用?C# Tree.BuildTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tree
的用法示例。
在下文中一共展示了Tree.BuildTree方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MakeMenu
public string MakeMenu(string givenMenu, Category currentCategory, string currentLanguage, string styleClass)
{
Menu menu = new Menu(); //("", "", "", 0, "", null, null, 0);
User user = (User) Controller.Context.Session[Constants.USER];
Tree mw = new Tree (givenMenu, currentCategory, menu, user);
return mw.BuildTree(currentLanguage, 1, styleClass);
}
示例2: Main
public static int Main(string[] args)
{
int numNodes = DEFAULT;
if (args.Length > 0)
{
if (args[0].Equals("/?"))
{
Usage();
return 0;
}
try
{
numNodes = int.Parse(args[0]);
}
catch (FormatException)
{
Usage();
return 0;
}
if (numNodes <= 0)
{
Usage();
return 0;
}
}
//TestLibrary.Logging.WriteLine("Forcing JIT of overflow path....");
try
{
// must force this exception
throw new OverflowException();
}
catch (OverflowException) { }
TestLibrary.Logging.WriteLine("Constructing Red-Black Tree with {0} nodes", numNodes);
TestLibrary.Logging.WriteLine("Using {0} as random seed", Tree.Seed);
Tree rbtree = new Tree(numNodes);
rbtree.BuildTree();
TestLibrary.Logging.WriteLine("Deleting random nodes and re-adjusting tree");
rbtree.DeleteTree();
TestLibrary.Logging.WriteLine("Test Passed");
return 100;
}
示例3: BuildTreeMapaWeb
public string BuildTreeMapaWeb (string givenMenu, Category currentCategory, string currentLanguage, string styleClass)
{
Menu menu = new Menu("", "", "showAllChilds", 0, "", null, null, 0);
User user = (User) Controller.Context.Session[Constants.USER];
Tree mw = new Tree (givenMenu, currentCategory, menu, user);
return mw.BuildTree(currentLanguage, 999, styleClass);
}