Browse Source

Addeed first version of WPF NewFileWindow. Needs more revisions to have parity with original.

Categories do work
pull/517/head^2
Ciprian Khlud 11 years ago
parent
commit
1251b8b911
  1. 100
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  2. 35
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileCategory.cs
  3. 15
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileTemplateItem.cs
  4. 65
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileViewModel.cs
  5. 81
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileWindow.xaml
  6. 92
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileWindow.xaml.cs
  7. 28
      src/Main/ICSharpCode.Core.WinForms/ICSharpCode.Core.WinForms.csproj
  8. 13
      src/Main/SharpDevelop/Services/UIService.cs

100
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -272,7 +272,9 @@ @@ -272,7 +272,9 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\Gui\Components\LocalizedPropertyGrid\BooleanTypeConverter.cs" />
<Compile Include="Src\Gui\Components\SideBar\TextEditorSideBar.cs" />
<Compile Include="Src\Gui\Components\SideBar\TextEditorSideBar.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Components\StringListEditorDialog.xaml.cs">
<DependentUpon>StringListEditorDialog.xaml</DependentUpon>
</Compile>
@ -281,15 +283,26 @@ @@ -281,15 +283,26 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\Gui\CustomFocusManager.cs" />
<Compile Include="Src\Gui\Dialogs\AsynchronousWaitDialog.cs" />
<Compile Include="Src\Gui\Dialogs\AsynchronousWaitDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\AsynchronousWaitDialog.Designer.cs">
<DependentUpon>AsynchronousWaitDialog.cs</DependentUpon>
</Compile>
<Compile Include="Src\Gui\Dialogs\AbstractAttachToProcessForm.cs" />
<Compile Include="Src\Gui\Dialogs\AbstractAttachToProcessForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\AbstractAttachToProcessForm.Designer.cs">
<DependentUpon>AbstractAttachToProcessForm.cs</DependentUpon>
</Compile>
<Compile Include="Src\Gui\Dialogs\NewFileCategory.cs" />
<Compile Include="Src\Gui\Dialogs\ExtractInterfaceDialog.cs" />
<Compile Include="Src\Gui\Dialogs\NewFileTemplateItem.cs" />
<Compile Include="Src\Gui\Dialogs\NewFileViewModel.cs" />
<Compile Include="Src\Gui\Dialogs\NewFileWindow.xaml.cs">
<DependentUpon>NewFileWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\OutputWindowOptionsPanel.xaml.cs">
<DependentUpon>OutputWindowOptionsPanel.xaml</DependentUpon>
<SubType>Code</SubType>
@ -410,10 +423,10 @@ @@ -410,10 +423,10 @@
<Compile Include="Src\Gui\Dialogs\ExtractInterfaceDialog.Designer.cs">
<DependentUpon>ExtractInterfaceDialog.cs</DependentUpon>
</Compile>
<Compile Include="Src\Gui\Dialogs\GotoDialog.cs">
<Compile Include="Src\Gui\Dialogs\GotoDialog.cs" />
<Compile Include="Src\Gui\Dialogs\NewProjectDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\NewProjectDialog.cs" />
<Compile Include="Src\Gui\Dialogs\NewProjectDialog.Designer.cs">
<DependentUpon>NewProjectDialog.cs</DependentUpon>
</Compile>
@ -536,11 +549,15 @@ @@ -536,11 +549,15 @@
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference\SvcUtilMessageView.cs" />
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference\SvcUtilPath.cs" />
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference\SvcUtilRunner.cs" />
<Compile Include="Src\Gui\Dialogs\ToolNotFoundDialog.cs" />
<Compile Include="Src\Gui\Dialogs\ToolNotFoundDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\ToolNotFoundDialog.Designer.cs">
<DependentUpon>ToolNotFoundDialog.cs</DependentUpon>
</Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\XmlFormsOptionPanel.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\XmlFormsOptionPanel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\TabbedOptionsDialog.xaml.cs">
<DependentUpon>TabbedOptionsDialog.xaml</DependentUpon>
<SubType>Code</SubType>
@ -657,11 +674,9 @@ @@ -657,11 +674,9 @@
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Components\SideBar\SharpDevelopSideTabItem.cs" />
<Compile Include="Src\Gui\Dialogs\AbstractOptionPanel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\AbstractOptionPanel.cs" />
<Compile Include="Src\Gui\Dialogs\CommonAboutDialog.cs">
<SubType>Form</SubType>
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\NewFileDialog.cs">
<SubType>Form</SubType>
@ -669,9 +684,7 @@ @@ -669,9 +684,7 @@
<Compile Include="Src\Gui\Dialogs\SharpDevelopAboutPanels.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\TabbedOptions.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\TabbedOptions.cs" />
<Compile Include="Src\Gui\Dialogs\WordCountDialog.cs">
<SubType>Form</SubType>
</Compile>
@ -682,7 +695,7 @@ @@ -682,7 +695,7 @@
<SubType>Component</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\GacReferencePanel.cs">
<SubType>Component</SubType>
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\ProjectReferencePanel.cs">
<SubType>Component</SubType>
@ -807,7 +820,6 @@ @@ -807,7 +820,6 @@
<Compile Include="Src\Gui\Pads\PropertyPad\IDEContainer.cs" />
<Compile Include="Src\Gui\Pads\PropertyPad\PropertyContainer.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\BuildEvents.cs">
<SubType>UserControl</SubType>
<DependentUpon>BuildEvents.xaml</DependentUpon>
</Compile>
<Compile Include="Src\Gui\BrowserDisplayBinding\SchemeExtension.cs" />
@ -831,12 +843,18 @@ @@ -831,12 +843,18 @@
<Compile Include="Src\Services\RefactoringService\FindReferencesAndRenameHelper.cs" />
<Compile Include="Src\Internal\Doozers\DirectoryDoozer.cs" />
<Compile Include="Src\Project\ConfigurationGuiBinding.cs" />
<Compile Include="Src\Project\ChooseStorageLocationButton.cs" />
<Compile Include="Src\Project\ChooseStorageLocationButton.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Src\Gui\Pads\ProjectBrowser\NodeBuilder\NodeBuilders.cs" />
<Compile Include="Src\Gui\Pads\TaskList\TaskListPad.cs" />
<Compile Include="Src\Gui\FormLocationHelper.cs" />
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\AddWebReferenceDialog.cs" />
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\WebServicesView.cs" />
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\AddWebReferenceDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\WebServicesView.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Project\Items\WebReferencesProjectItem.cs" />
<Compile Include="Src\Gui\Pads\ProjectBrowser\NodeBuilder\WebReferenceNodeBuilder.cs" />
<Compile Include="Src\Gui\Pads\ProjectBrowser\TreeNodes\WebReferencesFolderNode.cs" />
@ -844,8 +862,12 @@ @@ -844,8 +862,12 @@
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\WebReferenceChanges.cs" />
<Compile Include="Src\Project\Converter\LanguageConverter.cs" />
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\HttpAuthenticationHeader.cs" />
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\UserCredentialsDialog.cs" />
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\WebServiceDiscoveryClientProtocol.cs" />
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\UserCredentialsDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\WebServiceDiscoveryClientProtocol.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\AsyncDiscoveryState.cs" />
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\DiscoveryNetworkCredential.cs" />
<Compile Include="..\..\GlobalAssemblyInfo.cs">
@ -861,7 +883,9 @@ @@ -861,7 +883,9 @@
<Compile Include="Src\Services\HelpProvider.cs" />
<Compile Include="Src\Services\ParserService\CodeCompletionOptions.cs" />
<Compile Include="Src\Internal\ConditionEvaluators\CompareProjectPropertyConditionEvaluator.cs" />
<Compile Include="Src\Gui\Dialogs\SharpDevelopColorDialog.cs" />
<Compile Include="Src\Gui\Dialogs\SharpDevelopColorDialog.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Src\Project\CustomTool.cs" />
<Compile Include="Src\Project\MSBuildBasedProject.cs" />
<Compile Include="Src\Project\MSBuildItemDefinitionGroup.cs" />
@ -878,22 +902,13 @@ @@ -878,22 +902,13 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Folder Include="Designer" />
<Folder Include="Dom\ClassBrowser" />
<Folder Include="Editor\CodeCompletion\Images" />
<Folder Include="Editor\ContextActions" />
<Folder Include="Debugging" />
<Folder Include="Project\TargetFrameworks" />
<Folder Include="Src\Editor\Dialogs" />
<Folder Include="Templates" />
<Folder Include="Project\Configuration" />
<Folder Include="Workbench\DisplayBinding" />
<Page Include="Editor\Bookmarks\BookmarkPadContent.xaml" />
<Page Include="Src\Editor\CodeCompletion\CodeCompletionPanelXaml.xaml" />
<Page Include="Src\Editor\Dialogs\RenameSymbolDialog.xaml" />
<Page Include="Src\Gui\Components\FontSelector.xaml" />
<Page Include="Src\Gui\Components\StringListEditorDialog.xaml" />
<Page Include="Src\Gui\Components\StringListEditorXaml.xaml" />
<Page Include="Src\Gui\Dialogs\NewFileWindow.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\ExternalToolPanel.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\IDEOptions\CodeGenerationPanel.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\IDEOptions\EditStandardHeaderPanel.xaml" />
@ -950,27 +965,6 @@ @@ -950,27 +965,6 @@
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
<Folder Include="Dom" />
<Folder Include="Editor" />
<Folder Include="Editor\Bookmarks" />
<Folder Include="Util" />
<Folder Include="Project" />
<Folder Include="Parser" />
<Folder Include="Project\Build" />
<Folder Include="Services" />
<Folder Include="WinForms" />
<Folder Include="Workbench" />
<Folder Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference" />
<Folder Include="Refactoring" />
<Folder Include="Src\Project\Behaviors" />
<Folder Include="Project\PortableLibrary" />
<Folder Include="themes" />
<Folder Include="Src\Editor\AvalonEdit" />
<Folder Include="Editor\CodeCompletion" />
<Folder Include="Src\Editor\Commands" />
<Folder Include="Editor\Search" />
<Folder Include="Src\Gui\Pads\TaskList" />
<Folder Include="Src\Services\NavigationService" />
<ProjectReference Include="..\..\ICSharpCode.Core.Presentation\ICSharpCode.Core.Presentation.csproj">
<Project>{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}</Project>
<Name>ICSharpCode.Core.Presentation</Name>

35
src/Main/Base/Project/Src/Gui/Dialogs/NewFileCategory.cs

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
using System.Collections.ObjectModel;
using ICSharpCode.SharpDevelop.Widgets;
namespace ICSharpCode.SharpDevelop.Gui
{
public class NewFileCategory : ViewModelBase
{
private string _displayName;
public NewFileCategory(string displayName)
{
Children = new ObservableCollection<NewFileCategory>();
Templates = new ObservableCollection<NewFileTemplateItem>();
DisplayName = displayName;
}
public ObservableCollection<NewFileCategory> Children { get; set; }
public ObservableCollection<NewFileTemplateItem> Templates { get; set; }
public string DisplayName
{
get { return _displayName; }
set
{
_displayName = value;
OnPropertyChanged();
}
}
public bool IsEmpty
{
get { return Children.Count == 0; }
}
}
}

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

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
using ICSharpCode.SharpDevelop.Templates;
using ICSharpCode.SharpDevelop.Widgets;
namespace ICSharpCode.SharpDevelop.Gui
{
public class NewFileTemplateItem : ViewModelBase
{
public NewFileTemplateItem(FileTemplate template)
{
Template = template;
}
public FileTemplate Template { get; private set; }
}
}

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

@ -0,0 +1,65 @@ @@ -0,0 +1,65 @@
/*
* Created by SharpDevelop.
* User: Ciprian Khlud
* Date: 7/19/2014
* Time: 10:52 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Templates;
using ICSharpCode.SharpDevelop.Widgets;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop.Gui
{
public class NewFileViewModel : ViewModelBase
{
public NewFileViewModel()
{
AllTemplate = new ObservableCollection<NewFileTemplateItem>();
Templates = new ObservableCollection<NewFileCategory>()
{
new NewFileCategory("Empty file")
};
Icons= new Dictionary<IImage, int>();
Categories = new ObservableCollection<NewFileCategory>();
}
public IProject Project
{
get;
set;
}
public DirectoryName BasePath
{
get;
set;
}
public bool AllowUntitledFiles
{
get;
set;
}
public FileTemplateResult Result { get; set; }
public string SearchFor { get; set; }
public string Description { get; set; }
public ObservableCollection<NewFileTemplateItem> AllTemplate { get; set; }
public Dictionary<IImage, int> Icons {
get;
set;
}
public ObservableCollection<NewFileCategory> Categories { get; set; }
public ObservableCollection<NewFileCategory> Templates { get; set; }
}
}

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

@ -0,0 +1,81 @@ @@ -0,0 +1,81 @@
<Window x:Class="ICSharpCode.SharpDevelop.Gui.NewFileWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui"
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
xmlns:core="http://icsharpcode.net/sharpdevelop/core"
Title="ICSharpCode.SharpDevelop.Gui"
WindowStartupLocation="CenterScreen"
Height="300" Width="500">
<Window.DataContext>
<gui:NewFileViewModel />
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition />
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions >
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text="Categories" />
<TreeView Grid.Row="1"
ItemsSource="{Binding Categories}"
x:Name="categoryTreeView">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
<TextBlock Text="{Binding DisplayName}" />
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</Grid>
<GridSplitter Grid.Column="1" Width="5" />
<Grid Grid.Column="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<TextBlock Text="Search:" VerticalAlignment="Center" />
<TextBox Text="{Binding SearchFor}" Margin="2" Width="100"></TextBox>
</StackPanel>
<ListBox Grid.Row="1" ItemsSource="{Binding Templates}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding DisplayName}"></TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
<StackPanel Grid.Row="2">
<TextBlock Text="{Binding Description}" ></TextBlock>
<widgets:UniformGridWithSpacing Columns="2" HorizontalAlignment="Right" Margin="0,4,12,12">
<Button
Content="{core:Localize Global.OKButtonText}"
IsDefault="True"
Name="okButton"
Style="{x:Static core:GlobalStyles.ButtonStyle}"
Click="okButtonClick" />
<Button
Content="{core:Localize Global.CancelButtonText}"
IsCancel="True"
Name="cancelButton"
Style="{x:Static core:GlobalStyles.ButtonStyle}"
Click="cancelButtonClick" />
</widgets:UniformGridWithSpacing>
</StackPanel>
</Grid>
</Window>

92
src/Main/Base/Project/Src/Gui/Dialogs/NewFileWindow.xaml.cs

@ -0,0 +1,92 @@ @@ -0,0 +1,92 @@
/*
* Created by SharpDevelop.
* User: Ciprian Khlud
* Date: 7/19/2014
* Time: 10:52 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Templates;
namespace ICSharpCode.SharpDevelop.Gui
{
/// <summary>
/// Interaction logic for NewFileWindow.xaml
/// </summary>
public partial class NewFileWindow : Window
{
public NewFileViewModel ViewModel
{
get
{
return (NewFileViewModel)DataContext;
}
}
public NewFileWindow()
{
InitializeComponent();
}
public NewFileWindow(IProject project, DirectoryName basePath, IEnumerable<TemplateCategory> templateCategories)
{
DataContext = new NewFileViewModel();
InitializeComponent();
ViewModel.Project = project;
ViewModel.BasePath = basePath;
ViewModel.AllowUntitledFiles = basePath == null;
InitializeTemplates(templateCategories, ViewModel.Categories);
}
void InitializeTemplates(IEnumerable<TemplateCategory> templateCategories, ObservableCollection<NewFileCategory> categories)
{
foreach (var templateCategory in Sorted(templateCategories)) {
var cat = CreateCategory(templateCategory);
categories.Add(cat);
}
}
IEnumerable<TemplateCategory> Sorted(IEnumerable<TemplateCategory> templateCategories)
{
return templateCategories.OrderByDescending(c => c.SortOrder).ThenBy(c => StringParser.Parse(c.DisplayName));
}
NewFileCategory CreateCategory(TemplateCategory templateCategory)
{
var node = new NewFileCategory(templateCategory.DisplayName);
foreach (var subcategory in Sorted(templateCategory.Subcategories))
{
var subnode = CreateCategory(subcategory);
node.Children.Add(subnode);
}
foreach (var template in templateCategory.Templates.OfType<FileTemplate>())
{
if (!template.IsVisible(ViewModel.Project))
continue;
var titem = new NewFileTemplateItem(template);
if (titem.Template.Icon != null)
{
ViewModel.Icons[titem.Template.Icon] = 0; // "create template icon"
}
ViewModel.AllTemplate.Add(titem);
node.Templates.Add(titem);
}
return node;
}
private void okButtonClick(object sender, RoutedEventArgs e)
{
Close();
}
private void cancelButtonClick(object sender, RoutedEventArgs e)
{
Close();
}
}
}

28
src/Main/ICSharpCode.Core.WinForms/ICSharpCode.Core.WinForms.csproj

@ -63,19 +63,29 @@ @@ -63,19 +63,29 @@
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Menu\IStatusUpdate.cs" />
<Compile Include="Menu\Menu.cs" />
<Compile Include="Menu\Menu.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Menu\MenuCheckBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Menu\MenuCommand.cs" />
<Compile Include="Menu\MenuSeparator.cs" />
<Compile Include="Menu\MenuCommand.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Menu\MenuSeparator.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Menu\MenuService.cs" />
<Compile Include="MessageService\CustomDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MessageService\IDialogMessageService.cs" />
<Compile Include="MessageService\InputBox.cs" />
<Compile Include="MessageService\SaveErrorChooseDialog.cs" />
<Compile Include="MessageService\InputBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MessageService\SaveErrorChooseDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MessageService\SaveErrorInformDialog.cs">
<SubType>Form</SubType>
</Compile>
@ -84,11 +94,15 @@ @@ -84,11 +94,15 @@
<Compile Include="ToolBar\ToolBarCheckBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="ToolBar\ToolBarCommand.cs" />
<Compile Include="ToolBar\ToolBarCommand.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="ToolBar\ToolBarDropDownButton.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="ToolBar\ToolBarLabel.cs" />
<Compile Include="ToolBar\ToolBarLabel.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="ToolBar\ToolBarSeparator.cs">
<SubType>Component</SubType>
</Compile>

13
src/Main/SharpDevelop/Services/UIService.cs

@ -16,6 +16,8 @@ @@ -16,6 +16,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//#define EXPERIMENTAL_NEW_FILE
using System;
using System.Collections.Generic;
using System.Linq;
@ -49,6 +51,17 @@ namespace ICSharpCode.SharpDevelop @@ -49,6 +51,17 @@ namespace ICSharpCode.SharpDevelop
#if DEBUG
SD.Templates.UpdateTemplates();
#endif
#if EXPERIMENTAL_NEW_FILE
var nfdWpf = new NewFileWindow(project, directory, templates ?? SD.Templates.TemplateCategories);
if (nfdWpf.ShowDialog() ?? false)
{
return nfdWpf.ViewModel.Result;
}
else
{
return null;
}
#endif
using (NewFileDialog nfd = new NewFileDialog(project, directory, templates ?? SD.Templates.TemplateCategories)) {
if (nfd.ShowDialog(SD.WinForms.MainWin32Window) == DialogResult.OK)
return nfd.result;

Loading…
Cancel
Save