Advertisement
jlind0

Untitled

Mar 3rd, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. public static class QDMTestFactory
  2.     {
  3.         private static Func<TaborArb2074, QDMTest> FactoryMethod { get; set; }
  4.         public static void Initalize(Func<TaborArb2074, QDMTest> factoryMethod)
  5.         {
  6.             FactoryMethod = factoryMethod;
  7.         }
  8.         public static QDMTest Create(TaborArb2074 taborArb)
  9.         {
  10.             if (FactoryMethod != null)
  11.                 return FactoryMethod(taborArb);
  12.             return new QDMTest(taborArb);
  13.         }
  14.     }
  15. public static class TaborArb2074Factory
  16.     {
  17.         private static Func<string, TaborArb2074> FactoryMethod { get; set; }
  18.         public static void Initialize(Func<string, TaborArb2074> factoryMethod)
  19.         {
  20.             FactoryMethod = factoryMethod;
  21.         }
  22.         public static TaborArb2074 Create(string address)
  23.         {
  24.             if (FactoryMethod != null)
  25.                 return FactoryMethod(address);
  26.             return new TaborArb2074(address);
  27.         }
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement