當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。