namespace HandBrake.ApplicationServices { using System; using Caliburn.Micro; using HandBrake.ApplicationServices.Services; using HandBrake.ApplicationServices.Services.Interfaces; using HandBrake.Interop; /// /// Tempory Class which manages services until Windosor is added back into the project to handle it for us. /// public class ServiceManager { /// /// Backing Field for the User Setting Service. /// private static IUserSettingService userSettingService; /// /// The Backing field for HandBrake Instance. /// private static HandBrakeInstance handBrakeInstance; /// /// Gets UserSettingService. /// public static IUserSettingService UserSettingService { get { try { return IoC.Get(); } catch (NullReferenceException) { // Hack until this legacy code for the forms gui is removed! } return userSettingService ?? (userSettingService = new UserSettingService()); } } /// /// Gets HandBrakeInstance. /// public static HandBrakeInstance HandBrakeInstance { get { return handBrakeInstance ?? (handBrakeInstance = new HandBrakeInstance()); } } } }