当前位置: 首页>>代码示例>>C#>>正文


C# Child.Dispose方法代码示例

本文整理汇总了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();
    }
//.........这里部分代码省略.........
开发者ID:Reticulatas,项目名称:MochaEngineFinal,代码行数:101,代码来源:director_classic_runme.cs


注:本文中的Child.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。