本文整理汇总了C#中Child.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Child.Dispose方法的具体用法?C# Child.Dispose怎么用?C# Child.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Child
的用法示例。
在下文中一共展示了Child.Dispose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main()
{
{
Person person = new Person();
check(person, "Person");
person.Dispose();
}
{
Person person = new Child();
check(person, "Child");
person.Dispose();
}
{
Person person = new GrandChild();
check(person, "GrandChild");
person.Dispose();
}
{
Person person = new TargetLangPerson();
check(person, "TargetLangPerson");
person.Dispose();
}
{
Person person = new TargetLangChild();
check(person, "TargetLangChild");
person.Dispose();
}
{
Person person = new TargetLangGrandChild();
check(person, "TargetLangGrandChild");
person.Dispose();
}
// Semis - don't override id() in target language
{
Person person = new TargetLangSemiPerson();
check(person, "Person");
person.Dispose();
}
{
Person person = new TargetLangSemiChild();
check(person, "Child");
person.Dispose();
}
{
Person person = new TargetLangSemiGrandChild();
check(person, "GrandChild");
person.Dispose();
}
// Orphans - don't override id() in C++
{
Person person = new OrphanPerson();
check(person, "Person");
person.Dispose();
}
{
Person person = new OrphanChild();
check(person, "Child");
person.Dispose();
}
{
Person person = new TargetLangOrphanPerson();
check(person, "TargetLangOrphanPerson");
person.Dispose();
}
{
Person person = new TargetLangOrphanChild();
check(person, "TargetLangOrphanChild");
person.Dispose();
}
// Duals - id() makes an upcall to the base id()
{
Person person = new TargetLangDualPerson();
check(person, "TargetLangDualPerson + Person");
person.Dispose();
}
{
Person person = new TargetLangDualChild();
check(person, "TargetLangDualChild + Child");
person.Dispose();
}
{
Person person = new TargetLangDualGrandChild();
check(person, "TargetLangDualGrandChild + GrandChild");
person.Dispose();
}
// Mix Orphans and Duals
{
Person person = new TargetLangDualOrphanPerson();
check(person, "TargetLangDualOrphanPerson + Person");
person.Dispose();
}
{
Person person = new TargetLangDualOrphanChild();
check(person, "TargetLangDualOrphanChild + Child");
person.Dispose();
}
//.........这里部分代码省略.........