Exemplo n.º 1
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    public void Awake()
    {
        if (m_instance == null)
        {
            m_instance = this;
        }
    }
Exemplo n.º 2
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    public void OnDestroy()
    {
        options.Save();

        if (m_instance == this)
        {
            m_instance = null;
        }

        m_UI.Destroy();

        if (m_navModes != null)
        {
            m_navModes.Destroy(); m_navModes = null;
        }
    }
Exemplo n.º 3
0
        /// <summary>
        /// Sets up and runs the application. The run method shall block until the application is shut down
        /// </summary>
        public int Run()
        {
            using (ComponentContainer ComponentContainer = new ComponentContainer(this.componentRepository))
            {
                ISplashScreen SplashScreen = ComponentContainer.TryResolveInstance <ISplashScreen>() ?? new SplashDummy();

                SplashScreen.Show();
                IApplicationMain ApplicationMain;

                try
                {
                    this.ResolveModules(ComponentContainer);
                    ApplicationMain = ComponentContainer.ResolveInstance <IApplicationMain>(status => SplashScreen.SetStatus(status));
                }
                finally
                {
                    SplashScreen.Hide();
                }

                //Get Main Module
                return(ApplicationMain.Run(ComponentContainer));
            }
        }