Browse Source

Added graphics support. Fixed description for every new file item.

pull/517/head^2
Ciprian Khlud 11 years ago
parent
commit
6b7915a088
  1. 14
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileTemplateItem.cs
  2. 3
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileViewModel.cs
  3. 11
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileWindow.xaml

14
src/Main/Base/Project/Src/Gui/Dialogs/NewFileTemplateItem.cs

@ -1,4 +1,7 @@
using ICSharpCode.SharpDevelop.Templates; using System.Windows.Media;
using System.Windows.Media.Imaging;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Templates;
using ICSharpCode.SharpDevelop.Widgets; using ICSharpCode.SharpDevelop.Widgets;
namespace ICSharpCode.SharpDevelop.Gui namespace ICSharpCode.SharpDevelop.Gui
@ -12,7 +15,14 @@ namespace ICSharpCode.SharpDevelop.Gui
public FileTemplate Template { get; private set; } public FileTemplate Template { get; private set; }
public string DisplayName { get { return Template.DisplayName; } } public string DisplayName { get { return Template.DisplayName; } }
public string Description { get { return Template.Description; } } public string Description { get {
return StringParser.Parse(Template.Description);
} }
public ImageSource Picture { get{
return Template.Icon.ImageSource;
}
}
public string Name { get { return Template.Name; } } public string Name { get { return Template.Name; } }
} }
} }

3
src/Main/Base/Project/Src/Gui/Dialogs/NewFileViewModel.cs

@ -9,6 +9,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Templates; using ICSharpCode.SharpDevelop.Templates;
@ -102,7 +103,7 @@ namespace ICSharpCode.SharpDevelop.Gui
set; set;
} }
public FileTemplateResult Result { get; set; } public FileTemplateResult Result { get;set; }
public string SearchFor public string SearchFor
{ {

11
src/Main/Base/Project/Src/Gui/Dialogs/NewFileWindow.xaml

@ -57,10 +57,13 @@
> >
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel> <StackPanel Orientation="Horizontal">
<Label Content="{Binding DisplayName}" FontWeight="Bold" /> <Image Source="{Binding Picture}" Width="32" />
<Label Content="{Binding Description}" /> <StackPanel>
</StackPanel> <Label Content="{Binding DisplayName}" FontWeight="Bold" />
<Label Content="{Binding Description}" />
</StackPanel>
</StackPanel>
</DataTemplate> </DataTemplate>
</ListBox.ItemTemplate> </ListBox.ItemTemplate>
</ListBox> </ListBox>

Loading…
Cancel
Save