|
|
|
@ -7,14 +7,18 @@ |
|
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Collections.Generic; |
|
|
|
|
|
|
|
using System.Collections.ObjectModel; |
|
|
|
|
|
|
|
using System.ComponentModel; |
|
|
|
using System.IO; |
|
|
|
using System.IO; |
|
|
|
|
|
|
|
using System.Linq; |
|
|
|
|
|
|
|
using System.Threading; |
|
|
|
using System.Windows; |
|
|
|
using System.Windows; |
|
|
|
using System.Windows.Controls; |
|
|
|
using System.Windows.Controls; |
|
|
|
using System.Windows.Documents; |
|
|
|
using System.Windows.Documents; |
|
|
|
using System.Windows.Input; |
|
|
|
using System.Windows.Input; |
|
|
|
|
|
|
|
|
|
|
|
using ICSharpCode.Core.Presentation; |
|
|
|
using ICSharpCode.Core.Presentation; |
|
|
|
using ICSharpCode.SharpDevelop; |
|
|
|
using ICSharpCode.SharpDevelop; |
|
|
|
|
|
|
|
using ICSharpCode.SharpDevelop.Gui; |
|
|
|
using ICSharpCode.SharpDevelop.Project; |
|
|
|
using ICSharpCode.SharpDevelop.Project; |
|
|
|
|
|
|
|
|
|
|
|
namespace ICSharpCode.StartPage |
|
|
|
namespace ICSharpCode.StartPage |
|
|
|
@ -39,29 +43,45 @@ namespace ICSharpCode.StartPage |
|
|
|
set { SetValue(HeaderProperty, value); } |
|
|
|
set { SetValue(HeaderProperty, value); } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void BuildRecentProjectList() |
|
|
|
void BuildRecentProjectList() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// When building the project list we access the .sln files (to see if they still exist).
|
|
|
|
|
|
|
|
// Because those might be stored on a slow network drive, we do this on a background thread so that
|
|
|
|
|
|
|
|
// SharpDevelop startup doesn't have to wait.
|
|
|
|
|
|
|
|
ThreadPool.QueueUserWorkItem(AsyncBuildRecentProjectList, FileService.RecentOpen.RecentProject.ToArray()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AsyncBuildRecentProjectList(object state) |
|
|
|
{ |
|
|
|
{ |
|
|
|
List<RecentOpenItem> items = new List<RecentOpenItem>(); |
|
|
|
List<RecentOpenItem> items = new List<RecentOpenItem>(); |
|
|
|
foreach (string path in FileService.RecentOpen.RecentProject) { |
|
|
|
foreach (string path in (string[])state) { |
|
|
|
FileInfo file = new FileInfo(path); |
|
|
|
FileInfo file = new FileInfo(path); |
|
|
|
if (file.Exists) { |
|
|
|
if (file.Exists) { |
|
|
|
items.Add( |
|
|
|
items.Add( |
|
|
|
new RecentOpenItem { |
|
|
|
new RecentOpenItem { |
|
|
|
Name = System.IO.Path.GetFileNameWithoutExtension(path), |
|
|
|
Name = Path.GetFileNameWithoutExtension(path), |
|
|
|
LastModification = file.LastWriteTime.ToShortDateString(), |
|
|
|
LastModification = file.LastWriteTime.ToShortDateString(), |
|
|
|
Path = path |
|
|
|
Path = path |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (items.Count > 0) { |
|
|
|
|
|
|
|
WorkbenchSingleton.SafeThreadAsyncCall(new Action( |
|
|
|
|
|
|
|
delegate { |
|
|
|
lastProjectsListView.ItemsSource = items; |
|
|
|
lastProjectsListView.ItemsSource = items; |
|
|
|
lastProjectsListView.Visibility = items.Count > 0 ? Visibility.Visible : Visibility.Collapsed; |
|
|
|
lastProjectsListView.Visibility = Visibility.Visible; |
|
|
|
|
|
|
|
})); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class RecentOpenItem |
|
|
|
class RecentOpenItem : INotifyPropertyChanged |
|
|
|
{ |
|
|
|
{ |
|
|
|
public string Name { get; set; } |
|
|
|
public string Name { get; set; } |
|
|
|
public string LastModification { get; set; } |
|
|
|
public string LastModification { get; set; } |
|
|
|
public string Path { get; set; } |
|
|
|
public string Path { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged { add { } remove { } } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void lastProjectsDoubleClick(object sender, RoutedEventArgs e) |
|
|
|
void lastProjectsDoubleClick(object sender, RoutedEventArgs e) |
|
|
|
|