Created
March 19, 2012 23:40
-
-
Save ctolkien/2128488 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace ConsoleApplication2 | |
{ | |
class Program { | |
static void Main(string[] args) { | |
var foo = new List<ISupport>(); | |
foo.Add(new FlatPoint()); | |
draw_Supports(foo); | |
} | |
public static void draw_Supports(IList<ISupport> supports) { | |
foreach (var item in supports) { | |
Console.WriteLine(item.DoSomething()); | |
} | |
Console.ReadKey(); | |
} | |
} | |
public interface ISupport { | |
string DoSomething(); | |
} | |
public class FlatPoint : ISupport { | |
public string DoSomething() { | |
return "Works!"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment