本文整理汇总了C#中TreeList.Add方法的典型用法代码示例。如果您正苦于以下问题:C# TreeList.Add方法的具体用法?C# TreeList.Add怎么用?C# TreeList.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeList
的用法示例。
在下文中一共展示了TreeList.Add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddFiles
void AddFiles(TreeList<TestFile> tree, Folder testFolder, Folder resultFolder)
{
foreach (var name in suite.TestNames(testFolder)) {
var testFile = new TestFile {
FileName = Path.GetFileNameWithoutExtension(name), Path = tree.Value.FullName
};
var result = new TestResult(resultFolder, testFile);
testFile.TestStatus = result.Status;
tree.Add(testFile);
}
foreach (var subfolder in suite.SubFolders(testFolder)) {
var branch = new TreeList<TestFile>(new TestFile {FileName = subfolder.Name(), Path = tree.Value.FullName, IsFolder = true});
tree.Add(branch);
AddFiles(branch, subfolder, resultFolder.SubFolder(subfolder.Name()));
}
}
示例2: AddAndEnumerateOneThousandElementsWithNodeSizeTen
public void AddAndEnumerateOneThousandElementsWithNodeSizeTen()
{
TreeList<int> list = new TreeList<int>(10);
for (int k = 1; k <= 1000; k++)
list.Add(k);
Assert.AreEqual(1000, list.Count);
int j = 0;
foreach (var n in list)
Assert.AreEqual(++j, n);
Assert.AreEqual(1000, j);
}
示例3: AddAndEnumerateOneHundredElements
public void AddAndEnumerateOneHundredElements()
{
TreeList<int> list = new TreeList<int>();
for (int k = 1; k <= 100; k++)
list.Add(k);
Assert.AreEqual(100, list.Count);
int j = 0;
foreach (var n in list)
Assert.AreEqual(++j, n);
Assert.AreEqual(100, j);
}
示例4: AddOneElement
public void AddOneElement()
{
TreeList<int> list = new TreeList<int>();
list.Add(1);
Assert.AreEqual(1, list.Count);
}