Skip to content

Instantly share code, notes, and snippets.

@ctolkien
Created March 19, 2012 23:40
Show Gist options
  • Save ctolkien/2128488 to your computer and use it in GitHub Desktop.
Save ctolkien/2128488 to your computer and use it in GitHub Desktop.
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