/// <summary> /// Creates a new object. /// </summary> /// <param name="baseStationAircraftList"></param> /// <param name="flightSimulatorAircraftList"></param> /// <param name="uPnpManager"></param> /// <param name="webSite"></param> public PluginStartupParameters(IBaseStationAircraftList baseStationAircraftList, ISimpleAircraftList flightSimulatorAircraftList, IUniversalPlugAndPlayManager uPnpManager, IWebSite webSite) { AircraftList = baseStationAircraftList; FlightSimulatorAircraftList = flightSimulatorAircraftList; UPnpManager = uPnpManager; WebSite = webSite; }
/// <summary> /// See interface docs. /// </summary> /// <param name="uPnpManager"></param> /// <param name="flightSimulatorXAircraftList"></param> public void Initialise(IUniversalPlugAndPlayManager uPnpManager, ISimpleAircraftList flightSimulatorXAircraftList) { _FlightSimulatorXAircraftList = flightSimulatorXAircraftList; _UPnpManager = uPnpManager; webServerStatusControl.UPnpIsSupported = true; // IsSupported was in the original UPnP code but was dropped in the re-write. Keeping UI elements for it in case I decide to put it back. }
/// <summary> /// Creates a new object. /// </summary> /// <param name="flightSimulatorAircraftList"></param> /// <param name="uPnpManager"></param> /// <param name="webSite"></param> /// <param name="pluginFolder"></param> public PluginStartupParameters(ISimpleAircraftList flightSimulatorAircraftList, IUniversalPlugAndPlayManager uPnpManager, IWebSite webSite, string pluginFolder) { FlightSimulatorAircraftList = flightSimulatorAircraftList; UPnpManager = uPnpManager; WebSite = webSite; PluginFolder = pluginFolder; }
/// <summary> /// Displays the splash screen (whose presenter builds up most of the objects used by the program) and then the /// main view once the splash screen has finished. When the main view quits the program shuts down. /// </summary> /// <param name="args"></param> private static void StartApplication(string[] args) { IUniversalPlugAndPlayManager uPnpManager = null; IBaseStationAircraftList baseStationAircraftList = null; ISimpleAircraftList flightSimulatorXAircraftList = null; bool loadSucceded = false; using (var splashScreen = new SplashView()) { splashScreen.Initialise(args, BackgroundThread_ExceptionCaught); splashScreen.ShowDialog(); loadSucceded = splashScreen.LoadSucceeded; uPnpManager = splashScreen.UPnpManager; baseStationAircraftList = splashScreen.BaseStationAircraftList; flightSimulatorXAircraftList = splashScreen.FlightSimulatorXAircraftList; } try { if (loadSucceded) { using (var mainWindow = new MainView()) { _MainView = mainWindow; mainWindow.Initialise(uPnpManager, baseStationAircraftList, flightSimulatorXAircraftList); mainWindow.ShowDialog(); } } } finally { using (var shutdownWindow = new ShutdownView()) { shutdownWindow.Initialise(uPnpManager, baseStationAircraftList); shutdownWindow.ShowDialog(); Thread.Sleep(1000); } } }
public void TestInitialise() { _AircraftList = Factory.Singleton.Resolve<ISimpleAircraftList>(); _Aircraft = new Mock<IAircraft>() { DefaultValue = DefaultValue.Mock }.SetupAllProperties(); _Aircraft.Setup(m => m.Clone()).Returns(() => { var result = new Mock<IAircraft>() { DefaultValue = DefaultValue.Mock }.SetupAllProperties(); result.Object.UniqueId = _Aircraft.Object.UniqueId; return result.Object; }); }
public void TestInitialise() { _AircraftList = Factory.Singleton.Resolve <ISimpleAircraftList>(); _Aircraft = new Mock <IAircraft>() { DefaultValue = DefaultValue.Mock }.SetupAllProperties(); _Aircraft.Setup(m => m.Clone()).Returns(() => { var result = new Mock <IAircraft>() { DefaultValue = DefaultValue.Mock }.SetupAllProperties(); result.Object.UniqueId = _Aircraft.Object.UniqueId; return(result.Object); }); }
/// <summary> /// Displays the splash screen (whose presenter builds up most of the objects used by the program) and then the /// main view once the splash screen has finished. When the main view quits the program shuts down. /// </summary> /// <param name="args"></param> private static void StartApplication(string[] args) { IUniversalPlugAndPlayManager uPnpManager = null; IBaseStationAircraftList baseStationAircraftList = null; ISimpleAircraftList flightSimulatorXAircraftList = null; bool loadSucceded = false; using (var splashScreen = Factory.Singleton.Resolve <ISplashView>()) { splashScreen.Initialise(args, BackgroundThread_ExceptionCaught); splashScreen.ShowView(); loadSucceded = splashScreen.LoadSucceeded; uPnpManager = splashScreen.UPnpManager; baseStationAircraftList = splashScreen.BaseStationAircraftList; flightSimulatorXAircraftList = splashScreen.FlightSimulatorXAircraftList; } try { if (loadSucceded) { var pluginManager = Factory.Singleton.Resolve <IPluginManager>().Singleton; foreach (var plugin in pluginManager.LoadedPlugins) { try { plugin.GuiThreadStartup(); } catch (Exception ex) { var log = Factory.Singleton.Resolve <ILog>().Singleton; log.WriteLine("Caught exception in {0} plugin while calling GuiThreadStartup: {1}", plugin.Name, ex); } } using (var mainWindow = Factory.Singleton.Resolve <IMainView>()) { _MainView = mainWindow; mainWindow.Initialise(uPnpManager, flightSimulatorXAircraftList); mainWindow.ShowView(); } } } finally { using (var shutdownWindow = Factory.Singleton.Resolve <IShutdownView>()) { shutdownWindow.Initialise(uPnpManager, baseStationAircraftList); shutdownWindow.ShowView(); Thread.Sleep(1000); } } }
public void TestInitialise() { _OriginalClassFactory = Factory.TakeSnapshot(); _Clock = new ClockMock(); Factory.Singleton.RegisterInstance <IClock>(_Clock.Object); _AircraftList = Factory.Singleton.Resolve <ISimpleAircraftList>(); _Aircraft = new Mock <IAircraft>() { DefaultValue = DefaultValue.Mock }.SetupAllProperties(); _Aircraft.Setup(m => m.Clone()).Returns(() => { var result = new Mock <IAircraft>() { DefaultValue = DefaultValue.Mock }.SetupAllProperties(); result.Object.UniqueId = _Aircraft.Object.UniqueId; return(result.Object); }); }
/// <summary> /// See interface docs. /// </summary> /// <param name="baseStationAircraftList"></param> /// <param name="flightSimulatorAircraftList"></param> /// <param name="webServer"></param> public void Initialise(IBaseStationAircraftList baseStationAircraftList, ISimpleAircraftList flightSimulatorAircraftList, IWebServer webServer) { _BaseStationAircraftList = baseStationAircraftList; _FlightSimulatorAircraftList = flightSimulatorAircraftList; _WebServer = webServer; }
public void Initialise(IUniversalPlugAndPlayManager unused1, ISimpleAircraftList unused2) { ; }
#pragma warning restore 0067 public MainView(IUniversalPlugAndPlayManager uPnpManager, ISimpleAircraftList flightSimulatorXAircraftList) { _UPnpManager = uPnpManager; _FlightSimulatorXAircraftList = flightSimulatorXAircraftList; }
/// <summary> /// Displays the splash screen (whose presenter builds up most of the objects used by the program) and then the /// main view once the splash screen has finished. When the main view quits the program shuts down. /// </summary> /// <param name="args"></param> public static void StartApplication(string[] args) { IUniversalPlugAndPlayManager uPnpManager = null; IBaseStationAircraftList baseStationAircraftList = null; ISimpleAircraftList flightSimulatorXAircraftList = null; bool loadSucceded = false; try { using (var splashScreen = Factory.Resolve <ISplashView>()) { splashScreen.Initialise(args, BackgroundThread_ExceptionCaught); splashScreen.ShowView(); loadSucceded = splashScreen.LoadSucceeded; uPnpManager = splashScreen.UPnpManager; baseStationAircraftList = splashScreen.BaseStationAircraftList; flightSimulatorXAircraftList = splashScreen.FlightSimulatorXAircraftList; } var shutdownSignalHandler = Factory.ResolveSingleton <IShutdownSignalHandler>(); try { if (loadSucceded) { var pluginManager = Factory.ResolveSingleton <IPluginManager>(); foreach (var plugin in pluginManager.LoadedPlugins) { try { plugin.GuiThreadStartup(); } catch (Exception ex) { var log = Factory.ResolveSingleton <ILog>(); log.WriteLine($"Caught exception in {plugin.Name} plugin while calling GuiThreadStartup: {ex}"); } } try { using (var mainWindow = Factory.Resolve <IMainView>()) { MainView = mainWindow; mainWindow.Initialise(uPnpManager, flightSimulatorXAircraftList); shutdownSignalHandler.CloseMainViewOnShutdownSignal(); mainWindow.ShowView(); } } finally { MainView = null; } } } finally { shutdownSignalHandler.Cleanup(); using (var shutdownWindow = Factory.Resolve <IShutdownView>()) { shutdownWindow.Initialise(uPnpManager, baseStationAircraftList); shutdownWindow.ShowView(); Thread.Sleep(1000); } Factory.ResolveSingleton <ILog>().WriteLine("Clean shutdown complete"); } } finally { _ShutdownCompleteWaitHandle.Set(); } }
/// <summary> /// See interface docs. /// </summary> /// <param name="uPnpManager"></param> /// <param name="baseStationAircraftList"></param> /// <param name="flightSimulatorXAircraftList"></param> public void Initialise(IUniversalPlugAndPlayManager uPnpManager, IBaseStationAircraftList baseStationAircraftList, ISimpleAircraftList flightSimulatorXAircraftList) { _BaseStationAircraftList = baseStationAircraftList; _FlightSimulatorXAircraftList = flightSimulatorXAircraftList; _UPnpManager = uPnpManager; webServerStatusControl.UPnpIsSupported = true; // IsSupported was in the original UPnP code but was dropped in the re-write. Keeping UI elements for it in case I decide to put it back. }
/// <summary> /// See interface docs. /// </summary> /// <param name="uPnpManager"></param> /// <param name="flightSimulatorXAircraftList"></param> public void Initialise(IUniversalPlugAndPlayManager uPnpManager, ISimpleAircraftList flightSimulatorXAircraftList) { _UPnpManager = uPnpManager; }