/// <summary>
        /// This method should be always called after the constructor, because
        /// without this method FerdaForm wont work at all. It contains all the
        /// necessary setup for the form.
        /// </summary>
        /// <param name="pm">Project Manager of the application</param>
        /// <param name="prescreen">Prescreen where text about application
        /// loading is displayed</param>
        public void RightAfterConstructor(ProjectManager.ProjectManager pm, 
            FerdaPrescreen prescreen)
        {
            projectManager = pm;

            //fills the projectManager with some stuff
            FillPM();

            SizeChanged += new EventHandler(FormSizeChanged);
            Closing += new CancelEventHandler(FerdaForm_Closing);

            //loading the recent projects
            LoadRecentProjects();

            prescreen.DisplayText(ResManager.GetString("LoadingIcons"));
            LoadIcons();
            this.Icon = iconProvider["FerdaIcon"];

            prescreen.DisplayText(ResManager.GetString("LoadingSVG"));
            SetupSVG();
            prescreen.DisplayText(ResManager.GetString("LoadingMenus"));
            SetupStripes();

            prescreen.DisplayText(ResManager.GetString("LoadingContextHelp"));
            SetupContextHelp();
            prescreen.DisplayText(ResManager.GetString("LoadingProperties"));
            SetupProperties();

            prescreen.DisplayText(ResManager.GetString("LoadingArchive"));
            SetupArchive();
            prescreen.DisplayText(ResManager.GetString("LoadingNewBox"));
            SetupNewBox();
            SetupUserNote();
            prescreen.DisplayText(ResManager.GetString("LoadingDesktop"));
            SetupDesktop();

            //Because when the program is setting up the menu, all the views(desktops)
            //are closed. Thus it would put all the views into the open group. After
            //the inicialization of the desktops, all the dekstops are open - and
            //the behaviour is correct.
            menu.SetupDesktop();

            prescreen.DisplayText(ResManager.GetString("LoadingDocking"));
            SetupDocking();

            //Name and title of the application
            Name = "FerdaForm";
            Text = "Ferda DataMiner";

            //this command should be the last one, otherwise the window is not
            //maximized correctly
            WindowState = FormWindowState.Maximized;
        }
        static void Main(string [] args)
        {
            prescreen = new FerdaPrescreen();

            prescreen.Show();
            prescreen.Refresh();

            //tries to load the config
            try
            {
                iceConfig = FrontEndConfig.Load();
            }
            catch
            {
                prescreen.Hide();
                MessageBox.Show("Could not locate the FrontEndConfig.xml configuration file",
                    "Invalid config file",
                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            //loading the form
            FerdaForm form = new FerdaForm();
            form.SetupResources(iceConfig);

            //switching to the "bin" directory
            string previousDir = FrontEndCommon.SwitchToBinDirectory();

            prescreen.DisplayText(form.ResManager.GetString("LoadingProjectManager"));
            //loading the project manager
            ProjectManager.ProjectManager pm =
                new ProjectManager.ProjectManager(
                args,
                iceConfig.ProjectManagerOptions,
                new Ferda.FrontEnd.OutputI());

            //setting the form for the project manager
            form.RightAfterConstructor(pm, prescreen);

            prescreen.DisplayText(form.ResManager.GetString("LoadingAddIns"));
            //loading the add ins
            loadAddIns(form, pm.ModulesManager.Helper.ObjectAdapter, pm.ModulesManager, form.propertyGrid);
            pm.ModulesManager.AddModuleServices(iceConfig.FrontEndIceObjects);

            //switching to the directory from where it was executed
            FrontEndCommon.SwitchToPreviousDirectory(previousDir);

            //loading the associated file (if there is one)
            if (args.Length > 0 && !(args[0].StartsWith("--")))
            {
                FrontEndCommon.LoadProject(args[0], form, form.ResManager, ref pm,
                    form);
                form.AddToRecentProjects(args[0]);
                form.menu.SetupDesktop();
                form.WindowState = FormWindowState.Maximized;
            }

            prescreen.Hide();
            try
            {
                //running the application
                Application.Run(form);
            }
            finally
            {
                //clearing the add in and project manager resources
                addIns.Clear();
                pm.DestroyProjectManager();
            }

            form.SaveRecentProjects();

            //tries to save the config
            try
            {
                FrontEndConfig.Save(iceConfig);
            }
            catch
            {
                MessageBox.Show("Could not save the FrontEndConfig.xml configuration file",
                    "Invalid config file",
                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
        }