<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FClass%2FInterface_hierarchy</id>
		<title>Csharp/CSharp Tutorial/Class/Interface hierarchy - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FClass%2FInterface_hierarchy"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/Interface_hierarchy&amp;action=history"/>
		<updated>2026-04-29T19:35:35Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/Interface_hierarchy&amp;diff=5639&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/Interface_hierarchy&amp;diff=5639&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/Interface_hierarchy&amp;diff=5640&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/Interface_hierarchy&amp;diff=5640&amp;oldid=prev"/>
				<updated>2010-05-26T12:16:05Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Inheritance from both class and interface==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
public class Control {&lt;br /&gt;
    public void Serialize() {&lt;br /&gt;
        Console.WriteLine(&amp;quot;Control.Serialize called&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public interface IDataBound {&lt;br /&gt;
    void Serialize();&lt;br /&gt;
}&lt;br /&gt;
public class EditBox : Control, IDataBound {&lt;br /&gt;
}&lt;br /&gt;
class InterfaceInh2App {&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        EditBox edit = new EditBox();&lt;br /&gt;
        IDataBound bound = edit as IDataBound;&lt;br /&gt;
        if (bound != null) {&lt;br /&gt;
            Console.WriteLine(&amp;quot;IDataBound is supported...&amp;quot;);&lt;br /&gt;
            bound.Serialize();&lt;br /&gt;
        } else {&lt;br /&gt;
            Console.WriteLine(&amp;quot;IDataBound is NOT supported...&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interface Inheritance Demo==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
interface ITest {&lt;br /&gt;
    void Foo();&lt;br /&gt;
}&lt;br /&gt;
class Base : ITest {&lt;br /&gt;
    public void Foo() {&lt;br /&gt;
        Console.WriteLine(&amp;quot;Base.Foo (ITest implementation)&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
class MyDerived : Base {&lt;br /&gt;
    public new void Foo() {&lt;br /&gt;
        Console.WriteLine(&amp;quot;MyDerived.Foo&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class InterfaceInh3App {&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        MyDerived myDerived = new MyDerived();&lt;br /&gt;
        Console.WriteLine();&lt;br /&gt;
        myDerived.Foo();&lt;br /&gt;
        Console.WriteLine();&lt;br /&gt;
        ((ITest)myDerived).Foo();&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interfaces Based on Interfaces==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;OL&amp;gt;&amp;lt;LI&amp;gt;One interface can inherit another.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;The syntax is the same as for inheriting classes.&amp;lt;/LI&amp;gt;&amp;lt;/OL&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System.Runtime.Serialization;&lt;br /&gt;
using System;&lt;br /&gt;
interface IComparableSerializable : IComparable, ISerializable&lt;br /&gt;
{&lt;br /&gt;
    string GetStatusString();&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interfaces Inheriting Interfaces==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
interface Getter&lt;br /&gt;
{&lt;br /&gt;
   int GetData();&lt;br /&gt;
}&lt;br /&gt;
interface Setter&lt;br /&gt;
{&lt;br /&gt;
   void SetData(int x);&lt;br /&gt;
}&lt;br /&gt;
interface GetterAndSetter : Getter, Setter&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
class MyData : GetterAndSetter&lt;br /&gt;
{&lt;br /&gt;
   int data;&lt;br /&gt;
   public int GetData()&lt;br /&gt;
   {&lt;br /&gt;
      return data;&lt;br /&gt;
   }&lt;br /&gt;
   public void SetData(int x)&lt;br /&gt;
   {&lt;br /&gt;
      data = x;&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
   static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      MyData data = new MyData();&lt;br /&gt;
      data.SetData(5);&lt;br /&gt;
      Console.WriteLine(&amp;quot;{0}&amp;quot;, data.GetData());&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==One interface can inherit another.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System; &lt;br /&gt;
 &lt;br /&gt;
public interface BaseInterface { &lt;br /&gt;
  void meth1(); &lt;br /&gt;
  void meth2(); &lt;br /&gt;
} &lt;br /&gt;
 &lt;br /&gt;
// BaseInterface now includes meth1() and meth2() -- it adds meth3(). &lt;br /&gt;
public interface BaseInterface2 : BaseInterface { &lt;br /&gt;
  void meth3(); &lt;br /&gt;
} &lt;br /&gt;
 &lt;br /&gt;
// This class must implement all of BaseInterface and BaseInterface &lt;br /&gt;
class MyClass : BaseInterface2 { &lt;br /&gt;
  public void meth1() { &lt;br /&gt;
    Console.WriteLine(&amp;quot;Implement meth1().&amp;quot;); &lt;br /&gt;
  } &lt;br /&gt;
 &lt;br /&gt;
  public void meth2() { &lt;br /&gt;
    Console.WriteLine(&amp;quot;Implement meth2().&amp;quot;); &lt;br /&gt;
  } &lt;br /&gt;
 &lt;br /&gt;
  public void meth3() { &lt;br /&gt;
    Console.WriteLine(&amp;quot;Implement meth3().&amp;quot;); &lt;br /&gt;
  } &lt;br /&gt;
} &lt;br /&gt;
 &lt;br /&gt;
class MainClass { &lt;br /&gt;
  public static void Main() { &lt;br /&gt;
    MyClass ob = new MyClass(); &lt;br /&gt;
 &lt;br /&gt;
    ob.meth1(); &lt;br /&gt;
    ob.meth2(); &lt;br /&gt;
    ob.meth3(); &lt;br /&gt;
  } &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Implement meth1().&lt;br /&gt;
Implement meth2().&lt;br /&gt;
Implement meth3().&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>