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); } }
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); } }
public override void EndInit() { string mruRegKey = "SOFTWARE\\TypeSystemExplorer\\Config"; mruMenu = new MruStripMenuInline(MenuFile, MenuRecentFiles, new MruStripMenu.ClickedHandler(OnMruFile), mruRegKey + "\\MRU", true, 9); }
public PdfMergeForm(string cmdFile, string outFile) { this.InitializeComponent(); this.outBox.Text = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments), "merged.pdf"); this.dataGrid.AllowDrop = true; this.mruMenu = new MruStripMenuInline(this.fileToolStripMenuItem1, this.recentToolStripMenuItem, new MruStripMenu.ClickedHandler(this.OnMruFile), Program.MruRegKey); // initialize item level array; this.rowcolors.Add(new ItemLevel(Color.White, this.rowcolors.Count)); this.rowcolors.Add(new ItemLevel(Color.LightGray, this.rowcolors.Count)); this.rowcolors.Add(new ItemLevel(Color.LightCoral, this.rowcolors.Count)); this.rowcolors.Add(new ItemLevel(Color.LightCyan, this.rowcolors.Count)); this.rowcolors.Add(new ItemLevel(Color.LightBlue, this.rowcolors.Count)); this.rowcolors.Add(new ItemLevel(Color.LemonChiffon, this.rowcolors.Count)); this.rowcolors.Add(new ItemLevel(Color.LightPink, this.rowcolors.Count)); this.rowcolors.Add(new ItemLevel(Color.LightGreen, this.rowcolors.Count)); this.rowcolors.Add(new ItemLevel(Color.LightPink, this.rowcolors.Count)); this.rowcolors.Add(new ItemLevel(Color.LightSalmon, this.rowcolors.Count)); this.rowcolors.Add(new ItemLevel(Color.LightSeaGreen, this.rowcolors.Count)); this.rowcolors.Add(new ItemLevel(Color.LightSkyBlue, this.rowcolors.Count)); this.rowcolors.Add(new ItemLevel(Color.LightSlateGray, this.rowcolors.Count)); this.rowcolors.Add(new ItemLevel(Color.LightSteelBlue, this.rowcolors.Count)); this.rowcolors.Add(new ItemLevel(Color.LightYellow, this.rowcolors.Count)); while (this.rowcolors.Count < 21) { this.rowcolors.Add(new ItemLevel(Color.LightCyan, this.rowcolors.Count)); } this.comboBoxPageNumFormat.Items.Clear(); var values = Enum.GetValues(typeof(PaginationFormatting.PaginationFormats)); foreach (var fmt in values) { string s = fmt.ToString(); s = s.Replace("PF", string.Empty); s = s.Replace("_", " "); s = s.Replace("fwdslash", "/"); this.comboBoxPageNumFormat.Items.Add(s); } this.PaginationFormat = PaginationFormatting.PaginationFormats.PF_Page_1_of_N; if (outFile != string.Empty) { this.outBox.Text = outFile; } if (cmdFile != string.Empty) { try { this.merger.Load(cmdFile); this.mergerOrig = (SplitMergeCmdFile)this.merger.Clone(); this.currentFile = cmdFile; this.UpdateGrid(); } catch (Exception ex) { MessageBox.Show(ex.Message, "File Load Error", MessageBoxButtons.OK); } } }