本文整理匯總了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();
}
//.........這裏部分代碼省略.........