public LiveBrewCommandDispatcher GetLiveBrewCommandDispatcher(string fieldSection) { switch (fieldSection) { case "Weigh bin Mash Copper": case "MASH COPPER": liveBrewCommandDispatcher = MashCopperCommandDispatcher.GetInstance(); break; case "WEIGHBIN MASHTUN": case "MASH TUN": liveBrewCommandDispatcher = MashTunCommandDispatcher.GetInstance(); break; case "MASH FILTER": liveBrewCommandDispatcher = MashFilterCommandDispatcher.GetInstance(); break; case "HOLDING VESSEL": case "HOLDING VESSEL TO WORT COPPER": liveBrewCommandDispatcher = HoldingVesselCommandDispatcher.GetInstance(); break; case "WORT COPPER": liveBrewCommandDispatcher = WortCopperCommandDispatcher.GetInstance(); break; case "WHIRLPOOL": liveBrewCommandDispatcher = WhirlpoolCommandDispatcher.GetInstance(); break; } return(liveBrewCommandDispatcher); }
//lazy construction of instance public static WortCopperCommandDispatcher GetInstance() { if (_uniqueInstance == null) { _uniqueInstance = new WortCopperCommandDispatcher(); } return(_uniqueInstance); }