/// <summary> /// Called when an exit is requested. /// </summary> /// <param name="applicationFacade"> /// The object that contains the methods that allow interaction /// with the kernel. /// </param> private static void OnExit(IAbstractApplications applicationFacade) { // If there is no application facade, then we're in // designer mode, or something else silly. if (applicationFacade == null) { return; } // the only catch is that the Shutdown method will return before // we know if the shutdown will be cancelled? applicationFacade.Shutdown(); }
/// <summary> /// Loads the kernel. /// </summary> private static void LoadKernel() { // At a later stage we need to clean this up. // there are two constants and a DI reference. var bootstrapper = new KernelBootstrapper( s_ShutdownEvent, container => { s_UiContainer = container; s_ScriptHost = s_UiContainer.Resolve <IHostScripts>(); s_Diagnostics = s_UiContainer.Resolve <SystemDiagnostics>(); s_ApplicationFacade = s_UiContainer.Resolve <IAbstractApplications>(); }); // Load the core system. This will automatically // run the UI bootstrapper which will then // load up the UI and display it. bootstrapper.Load(); }
/// <summary> /// Loads the kernel. /// </summary> private static void LoadKernel() { // At a later stage we need to clean this up. // there are two constants and a DI reference. var bootstrapper = new KernelBootstrapper( s_ShutdownEvent, container => { s_UiContainer = container; s_ScriptHost = s_UiContainer.Resolve<IHostScripts>(); s_Diagnostics = s_UiContainer.Resolve<SystemDiagnostics>(); s_ApplicationFacade = s_UiContainer.Resolve<IAbstractApplications>(); }); // Load the core system. This will automatically // run the UI bootstrapper which will then // load up the UI and display it. bootstrapper.Load(); }
/// <summary> /// Initializes a new instance of the <see cref="ExitCommand"/> class. /// </summary> /// <param name="applicationFacade"> /// The object that contains the methods that allow interaction /// with the kernel. /// </param> public ExitCommand(IAbstractApplications applicationFacade) : base(obj => OnExit(applicationFacade), obj => CanExit(applicationFacade)) { }
private static bool CanExit(IAbstractApplications applicationFacade) { // If there is no application facade, then we're in // designer mode, or something else silly. return(applicationFacade != null); }