Ejemplo n.º 1
0
        private void CreateProject()
        {
            string       filePath;
            DialogResult result = Dialogs.CreateProjectDialog(this, out filePath);

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                syncProject.Create(filePath);
                ListviewHelper.ReloadListview(listView1, imageList, syncProject.SyncItems);
                recentProjectMenu.Notify(filePath);
                recentProjectMenu.CurrentlyOpenedFile = filePath;
                this.Text = WindowCaption();
                EnableControls();
            }
        }
Ejemplo n.º 2
0
 private void recentProjectMenu_RecentProjectOpened(object sender, RecentProjectEventArgs e)
 {
     if (File.Exists(e.RecentFile.FullPath))
     {
         syncProject.Load(e.RecentFile.FullPath);
         ListviewHelper.ReloadListview(listView1, imageList, syncProject.SyncItems);
         recentProjectMenu.Notify(e.RecentFile.FullPath);
         recentProjectMenu.CurrentlyOpenedFile = e.RecentFile.FullPath;
         ConfigSettings.LastProject            = e.RecentFile.FullPath;
         this.Text = WindowCaption();
         EnableControls();
     }
     else
     {
         DialogResult result = Dialogs.MissingRecentFileError(this);
         if (result == System.Windows.Forms.DialogResult.Yes)
         {
             recentProjectMenu.Remove(e.RecentFile.FullPath);
         }
     }
 }
Ejemplo n.º 3
0
 private bool LoadLastProject()
 {
     try
     {
         string lastProject = ConfigSettings.LastProject;
         if (!string.IsNullOrEmpty(lastProject))
         {
             syncProject.Load(lastProject);
             ListviewHelper.ReloadListview(listView1, imageList, syncProject.SyncItems);
             recentProjectMenu.Notify(lastProject);
             recentProjectMenu.CurrentlyOpenedFile = lastProject;
             this.Text = WindowCaption();
             EnableControls();
             return(true);
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(this, exception.Message, ConfigSettings.ApplicationTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     return(false);
 }