Advertisement
OedipusPrime

Untitled

Sep 23rd, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApplication1
  4. {
  5.     class Program
  6.     {
  7.         private static void Main(string[] args)
  8.         {
  9.             var x = new Manager<ISoccer>();
  10.             x.GetManager();
  11.             Console.ReadKey();
  12.         }
  13.     }
  14.  
  15.     public class Manager<T> where T : IBallGame, new()
  16.     {
  17.         public T GetManager()
  18.         {
  19.             return new T();
  20.         }
  21.     }
  22.  
  23.     public interface IBallGame
  24.     {
  25.     }
  26.  
  27.     public class ISoccer : IBallGame
  28.     {
  29.        
  30.     }
  31.  
  32.     public class Soccer : ISoccer
  33.     {
  34.        
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement