Advertisement
Chuiby

Untitled

May 11th, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1.     public abstract class DayInfo
  2.     {
  3.         protected void GetInfoCore()
  4.         {
  5.             throw new System.NotImplementedException();
  6.         }
  7.  
  8.         //Changed return type to "object" instead of "void"
  9.         public object GetInfo()
  10.         {
  11.             GetInfoCore();
  12.             return null;
  13.         }
  14.     }
  15.  
  16.     public class DayInfo<T> : DayInfo
  17.     {
  18.         private T info;
  19.  
  20.         public DayInfo(T data)
  21.         {
  22.             info = data;
  23.         }
  24.  
  25.         //If this is removed it will default back to the original function from the base class and throw an exception
  26.         public new T GetInfo()
  27.         {
  28.             return info;
  29.         }
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement