예제 #1
0
        public RecentFilesForm()
        {
            InitializeComponent();

            this.Text = Globals.ApplicationDisplayName + " - Loading";

            lstRecentFiles.DrawItem    += new DrawItemEventHandler(lstRecentFiles_DrawItem);
            lstRecentFiles.MeasureItem += new MeasureItemEventHandler(lstRecentFiles_MeasureItem);

            RecentFiles.Load();
            foreach (string recentFile in RecentFiles.Files)
            {
                lstRecentFiles.Items.Add(recentFile);
            }
        }
예제 #2
0
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog dlg = new FolderBrowserDialog();

            dlg.RootFolder          = Environment.SpecialFolder.Desktop;
            dlg.ShowNewFolderButton = false;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                txtSelectedFile.Text = dlg.SelectedPath;
                lstRecentFiles.Items.Add(dlg.SelectedPath);

                if (RecentFiles.Files.Contains(dlg.SelectedPath) == false)
                {
                    RecentFiles.Files.Add(dlg.SelectedPath);
                    RecentFiles.Save();
                }
            }
            this.DialogResult = DialogResult.None;
        }
예제 #3
0
 private void lnkClearHistory_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     RecentFiles.Files.Clear();
     RecentFiles.Save();
     lstRecentFiles.Items.Clear();
 }