本文整理汇总了C#中Region.AddChild方法的典型用法代码示例。如果您正苦于以下问题:C# Region.AddChild方法的具体用法?C# Region.AddChild怎么用?C# Region.AddChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Region
的用法示例。
在下文中一共展示了Region.AddChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: They_Should_Not_Show_In_The_Object_Heirarchy
public void They_Should_Not_Show_In_The_Object_Heirarchy()
{
Namespace ns = new Namespace(controller) { Index = 1};
Region region = new Region(controller, "RegionStart") { Index = 2};
Class clazz = new Class(controller, "Class1") { Index = 3};
region.AddChild(clazz);
ns.AddChild(region);
Assert.That(clazz.Parent, Is.SameAs(ns), "The parent of the Class should be the Namespace, not the Region");
}
示例2: They_Should_Not_Show_In_The_Fully_Qualified_Display_Name
public void They_Should_Not_Show_In_The_Fully_Qualified_Display_Name()
{
Namespace ns = new Namespace(controller);
Region region = new Region(controller, "RegionStart");
Class clazz = new Class(controller, "Class1");
region.AddChild(clazz);
ns.AddChild(region);
Assert.That(clazz.FullyQualifiedDisplayName.IndexOf("RegionStart") < 0,
"The fully qualified display name of the Class should not contain the region name");
}
示例3: AddRegion
private void AddRegion(ICodeRegion region, Region parentRegion)
{
var r = new Region();
r.Name = region.Name;
r.LineNumber = region.LineStart;
Debug.WriteLine("Added region {0} to {1}", r.Name, this.Name);
parentRegion.AddChild(r);
foreach (var nestedRegion in region.NestedRegions)
{
AddRegion(nestedRegion, r);
}
}