Exemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            UpgradeUserSettings();

            ToolBarNodes.InitDefaultToolBar(Settings.Default, MyConfiguration.KnownNodes);

            if (!TryRestoreViewsLayout(UserLayoutFileName))
            {
                ResetViewsLayout();
            }

            this.WindowState = FormWindowState.Maximized;
            statusStrip.BackColor = STATUS_BAR_BLUE;

            if (!TryOpenStartupProject())
            {
                OpenGraphLayout(Project.Network);
            }

            m_recentMenu = new MruStripMenuInline(fileToolStripMenuItem, recentFilesMenuItem , RecentFiles_Click, 5);

            Project.Restore();

            StringCollection recentFilesList = Settings.Default.RecentFilesList;

            if (recentFilesList != null)
            {
                string[] tmp = new string[recentFilesList.Count];
                recentFilesList.CopyTo(tmp, 0);
                m_recentMenu.AddFiles(tmp);
            }
        }
Exemplo n.º 2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            FileInfo viewLayoutFile = new FileInfo(UserLayoutFileName);

            if (viewLayoutFile.Exists)
            {
                RestoreViewsLayout(viewLayoutFile.FullName);
            }
            else
            {
                ResetViewsLayout();
            }

            this.WindowState = FormWindowState.Maximized;
            statusStrip.BackColor = STATUS_BAR_BLUE;

            if (!string.IsNullOrEmpty(MyConfiguration.OpenOnStartupProjectName))
            {
                if (!OpenProject(MyConfiguration.OpenOnStartupProjectName))
                {
                    OpenGraphLayout(Project.Network);
                }
            }
            else if (!string.IsNullOrEmpty(Properties.Settings.Default.LastProject))
            {
                if (!OpenProject(Properties.Settings.Default.LastProject))
                {
                    OpenGraphLayout(Project.Network);
                }
            }
            else
            {
                OpenGraphLayout(Project.Network);
            }

            m_recentMenu = new MruStripMenuInline(fileToolStripMenuItem, recentFilesMenuItem , RecentFiles_Click, 5);

            StringCollection recentFilesList = Properties.Settings.Default.RecentFilesList;

            if (recentFilesList != null)
            {
                string[] tmp = new string[recentFilesList.Count];
                recentFilesList.CopyTo(tmp, 0);
                m_recentMenu.AddFiles(tmp);
            }
        }