To execute the application, we need to retrieve the spring context and the controller manager. The controller manager will be used to execute a specific controller.
Modify the Start.cs as shown in the listing below:

static class Start
    {
        private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(Start).FullName);
        private static IControllerManager myControleurManager;

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
                        
            try
            {
                Console.WriteLine("...Initializing the application : Please wait...");

                //Launching the application
                IApplicationContext springContext = ContextRegistry.GetContext();
                myControleurManager = (IControllerManager)springContext.GetObject("ControllerManager"  typeOf…);
                myControleurManager.Invoke(typeof(ListController).Name, ApplicationData.InitAction);
            }
            catch (Exception e)
            {

                log.Error(e.ToString());

                Console.WriteLine("...Error while initializing the application please contact thhe administrator...");

                //Abnormal program termination, killing the process
                Environment.Exit(Environment.ExitCode);
            }
        }
    }

The result of running the application is shown on the figure below:

ContactList.png

Last edited Jun 22, 2009 at 8:47 AM by koossery, version 2

Comments

No comments yet.