Browse Source

Allow choosing the target framework when creating a new project.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2739 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 18 years ago
parent
commit
8f2e284793
  1. 5
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 9
      data/templates/project/CSharp/CompactFormsProject.xpt
  3. 2
      data/templates/project/CSharp/ConsoleProject.xpt
  4. 5
      data/templates/project/CSharp/ControlLibrary.xpt
  5. 1
      data/templates/project/CSharp/Direct3DProject.xpt
  6. 1
      data/templates/project/CSharp/EmptyProject.xpt
  7. 10
      data/templates/project/CSharp/FormsProject.xpt
  8. 6
      data/templates/project/CSharp/GladeProject.xpt
  9. 18
      data/templates/project/CSharp/GtkProject.xpt
  10. 10
      data/templates/project/CSharp/Library.xpt
  11. 72
      data/templates/project/CSharp/NotifyIcon.xpt
  12. 2
      data/templates/project/CSharp/Service.xpt
  13. 1
      data/templates/project/CSharp/SharedAddin.xpt
  14. 5
      data/templates/project/CSharp/SharpDevelopAddin.xpt
  15. 1
      data/templates/project/CSharp/SharpDevelopCustomTool.xpt
  16. 1
      data/templates/project/CSharp/SharpDevelopMacro.xpt
  17. 34
      data/templates/project/CSharp/WPFApplication.xpt
  18. 38
      data/templates/project/CSharp/WPFNavigationApplication.xpt
  19. 1
      data/templates/project/ComplexExample.xpt.test
  20. 58
      src/AddIns/BackendBindings/CSharpBinding/Project/Resources/BuildOptions.xfrm
  21. 3
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.cs
  22. 36
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpProject.cs
  23. 3
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/BuildOptions.cs
  24. 37
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/Project/VBNetProject.cs
  25. 4
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextEditorControlBase.cs
  26. 11
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  27. 1
      src/Main/Base/Project/Resources/GotoDialog.xfrm
  28. 1
      src/Main/Base/Project/Resources/NewFileDialog.xfrm
  29. 1
      src/Main/Base/Project/Resources/NewFileWithNameDialog.xfrm
  30. 226
      src/Main/Base/Project/Resources/NewProjectDialog.xfrm
  31. 338
      src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.Designer.cs
  32. 267
      src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs
  33. 120
      src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.resx
  34. 57
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs
  35. 75
      src/Main/Base/Project/Src/Internal/Templates/File/ScriptRunner.cs
  36. 69
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectCreateInformation.cs
  37. 3
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs
  38. 166
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs
  39. 6
      src/Main/Base/Project/Src/Internal/Templates/Project/SolutionDescriptor.cs
  40. 2
      src/Main/Base/Project/Src/Project/AbstractProject.cs
  41. 79
      src/Main/Base/Project/Src/Project/CompilableProject.cs
  42. 4
      src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs
  43. 3
      src/Main/Base/Project/Src/Project/Solution/Solution.cs
  44. 13
      src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs
  45. 11
      src/Main/Base/Project/Src/TextEditor/Commands/CodeGenerators/ConstructorCodeGenerator.cs
  46. 4
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs
  47. 13
      src/Main/Base/Project/Src/Util/ExtensionMethods.cs
  48. 24
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/CompoundClass.cs
  49. 2
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ProjectContent/DefaultProjectContent.cs

5
AddIns/ICSharpCode.SharpDevelop.addin

@ -2185,4 +2185,9 @@ @@ -2185,4 +2185,9 @@
</Condition>
</ComplexCondition>
</Path>
<Path name = "/SharpDevelop/BackendBindings/TemplateCommands">
<Class id="AddDotNet35ReferencesIfTargetFrameworkIs35"
class="ICSharpCode.SharpDevelop.Project.Commands.AddDotNet35ReferencesIfTargetFrameworkIs35Command"/>
</Path>
</AddIn>

9
data/templates/project/CSharp/CompactFormsProject.xpt

@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
<Subcategory>Compact Framework</Subcategory>
<Icon>C#.Project.Form</Icon>
<Description>${res:Templates.Project.WindowsApplication.Description}</Description>
<SupportedTargetFrameworks>CF 2.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->
@ -27,16 +28,8 @@ @@ -27,16 +28,8 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<PlatformFamilyName>PocketPC</PlatformFamilyName>
<PlatformID>WinCE</PlatformID>
<TargetFrameworkVersion>CF 2.0</TargetFrameworkVersion>
</PropertyGroup>
<Imports clear="true">
<Import Project="$(SharpDevelopBinPath)\SharpDevelop.Build.CSharp.targets" />
</Imports>
<Files>
<File name="MainForm.cs" language="C#"><![CDATA[${StandardHeader.C#}

2
data/templates/project/CSharp/ConsoleProject.xpt

@ -8,11 +8,13 @@ @@ -8,11 +8,13 @@
<Subcategory>${res:Templates.File.Categories.WindowsApplications}</Subcategory>
<Icon>C#.Project.DOSProject</Icon>
<Description>${res:Templates.Project.ConsoleProject.Description}</Description>
<SupportedTargetFrameworks>v2.0;Mono v2.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->
<Actions>
<Open filename = "Program.cs"/>
<RunCommand path = "/SharpDevelop/BackendBindings/TemplateCommands/AddDotNet35ReferencesIfTargetFrameworkIs35"/>
</Actions>
<!-- Template Content -->

5
data/templates/project/CSharp/ControlLibrary.xpt

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
<Subcategory>${res:Templates.File.Categories.WindowsApplications}</Subcategory>
<Icon>C#.Project.ControlLibrary</Icon>
<Description>${res:Templates.Project.UserControlLibrary.Description}</Description>
<SupportedTargetFrameworks>v2.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->
@ -58,7 +59,7 @@ namespace ${StandardNamespace} @@ -58,7 +59,7 @@ namespace ${StandardNamespace}
}
}
}]]></File>
<File name="UserControl1.Designer.cs" DependentUpon="UserControl1.cs" language="C#"><![CDATA[${StandardHeader.C#}
<File name="UserControl1.Designer.cs" DependentUpon="UserControl1.cs" language="C#"><![CDATA[${StandardHeader.C#}
namespace ${StandardNamespace}
{
partial class UserControl1
@ -98,7 +99,7 @@ namespace ${StandardNamespace} @@ -98,7 +99,7 @@ namespace ${StandardNamespace}
}
}
]]></File>
<File name="AssemblyInfo.cs" src="DefaultAssemblyInfo.cs"/>
<File name="AssemblyInfo.cs" src="DefaultAssemblyInfo.cs"/>
</Files>
</Project>
</Template>

1
data/templates/project/CSharp/Direct3DProject.xpt

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
<Subcategory>${res:Templates.File.Categories.WindowsApplications}</Subcategory>
<Icon>C#.Project.FullProject</Icon>
<Description>${res:Templates.Project.Direct3DApplication.Description}</Description>
<SupportedTargetFrameworks>v2.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->

1
data/templates/project/CSharp/EmptyProject.xpt

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
<Category>C#</Category>
<Icon>C#.Project.EmptyProject</Icon>
<Description>${res:Templates.Project.EmptyProject.Description}</Description>
<SupportedTargetFrameworks>v2.0;Mono;CF</SupportedTargetFrameworks>
</TemplateConfiguration>
<Project language = "C#">

10
data/templates/project/CSharp/FormsProject.xpt

@ -10,11 +10,13 @@ @@ -10,11 +10,13 @@
<Subcategory>${res:Templates.File.Categories.WindowsApplications}</Subcategory>
<Icon>C#.Project.Form</Icon>
<Description>${res:Templates.Project.WindowsApplication.Description}</Description>
<SupportedTargetFrameworks>v2.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->
<Actions>
<Open filename = "MainForm.cs"/>
<RunCommand path = "/SharpDevelop/BackendBindings/TemplateCommands/AddDotNet35ReferencesIfTargetFrameworkIs35"/>
</Actions>
<Project language = "C#">
@ -31,7 +33,7 @@ @@ -31,7 +33,7 @@
</PropertyGroup>
<Files>
<File name="Program.cs" language="C#"><![CDATA[${StandardHeader.C#}
<File name="Program.cs" language="C#"><![CDATA[${StandardHeader.C#}
using System;
using System.Windows.Forms;
@ -57,7 +59,7 @@ namespace ${StandardNamespace} @@ -57,7 +59,7 @@ namespace ${StandardNamespace}
}
}
]]></File>
<File name="MainForm.cs" language="C#"><![CDATA[${StandardHeader.C#}
<File name="MainForm.cs" language="C#"><![CDATA[${StandardHeader.C#}
using System;
using System.Collections.Generic;
@ -85,7 +87,7 @@ namespace ${StandardNamespace} @@ -85,7 +87,7 @@ namespace ${StandardNamespace}
}
}
]]></File>
<File name="MainForm.Designer.cs" DependentUpon="MainForm.cs" language="C#"><![CDATA[${StandardHeader.C#}
<File name="MainForm.Designer.cs" DependentUpon="MainForm.cs" language="C#"><![CDATA[${StandardHeader.C#}
namespace ${StandardNamespace}
{
partial class MainForm
@ -126,7 +128,7 @@ namespace ${StandardNamespace} @@ -126,7 +128,7 @@ namespace ${StandardNamespace}
}
}
]]></File>
<File name="AssemblyInfo.cs" src="DefaultAssemblyInfo.cs"/>
<File name="AssemblyInfo.cs" src="DefaultAssemblyInfo.cs"/>
</Files>
</Project>
</Template>

6
data/templates/project/CSharp/GladeProject.xpt

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
<Subcategory>Mono</Subcategory>
<Icon>C#.Project.Form</Icon>
<Description>${res:Templates.Project.GladeSharpProject.Description}</Description>
<SupportedTargetFrameworks>Mono</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->
@ -20,13 +21,8 @@ @@ -20,13 +21,8 @@
<Project language = "C#">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworkVersion>Mono v1.1</TargetFrameworkVersion>
</PropertyGroup>
<Imports clear="True">
<Import Project="$(SharpDevelopBinPath)\SharpDevelop.Build.CSharp.targets" />
</Imports>
<ProjectItems>
<Reference Include="atk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="gdk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />

18
data/templates/project/CSharp/GtkProject.xpt

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
<Subcategory>Mono</Subcategory>
<Icon>C#.Project.Form</Icon>
<Description>${res:Templates.Project.GtkSharpProject.Description}</Description>
<SupportedTargetFrameworks>Mono</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->
@ -20,20 +21,15 @@ @@ -20,20 +21,15 @@
<Project language = "C#">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworkVersion>Mono v1.1</TargetFrameworkVersion>
</PropertyGroup>
<Imports clear="True">
<Import Project="$(SharpDevelopBinPath)\SharpDevelop.Build.CSharp.targets" />
</Imports>
<ProjectItems>
<Reference Include="atk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="gdk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="glib-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="gtk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="pango-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<Reference Include="atk-sharp" />
<Reference Include="gdk-sharp" />
<Reference Include="glib-sharp" />
<Reference Include="gtk-sharp" />
<Reference Include="pango-sharp" />
<Reference Include="System" />
</ProjectItems>
<Files>

10
data/templates/project/CSharp/Library.xpt

@ -1,7 +1,5 @@ @@ -1,7 +1,5 @@
<?xml version="1.0"?>
<Template originator = "Mike Krueger"
created = "02/01/2003"
lastModified = "12/01/2006">
<Template originator = "Mike Krueger" created = "02/01/2003">
<!-- Template Header -->
<TemplateConfiguration>
@ -9,11 +7,13 @@ @@ -9,11 +7,13 @@
<Category>C#</Category>
<Icon>C#.Project.Library</Icon>
<Description>${res:Templates.Project.ClassLibrary.Description}</Description>
<SupportedTargetFrameworks>v2.0;Mono v2.0;CF 2.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->
<Actions>
<Open filename = "MyClass.cs"/>
<RunCommand path = "/SharpDevelop/BackendBindings/TemplateCommands/AddDotNet35ReferencesIfTargetFrameworkIs35"/>
</Actions>
<!-- Template Content -->
@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
<Reference Include="System" />
<Reference Include="System.Xml" />
</ProjectItems>
<Files>
<File name="MyClass.cs"><![CDATA[${StandardHeader.C#}
using System;
@ -42,7 +42,7 @@ namespace ${StandardNamespace} @@ -42,7 +42,7 @@ namespace ${StandardNamespace}
}
}]]></File>
<File name="AssemblyInfo.cs" src="DefaultAssemblyInfo.cs"/>
<File name="AssemblyInfo.cs" src="DefaultAssemblyInfo.cs"/>
</Files>
</Project>
</Template>

72
data/templates/project/CSharp/NotifyIcon.xpt

@ -2,36 +2,38 @@ @@ -2,36 +2,38 @@
<Template originator = "Justin Dearing"
created = "25/07/2006"
lastModified = "30/07/2006">
<!-- Template Header -->
<TemplateConfiguration>
<Name>${res:Templates.Project.SysTrayIcon.Name}</Name>
<Category>C#</Category>
<Subcategory>${res:Templates.File.Categories.WindowsApplications}</Subcategory>
<Icon>C#.Project.Form</Icon>
<Description>${res:Templates.Project.SysTrayIcon.Description}</Description>
</TemplateConfiguration>
<!-- Actions -->
<Actions>
<Open filename = "NotificationIcon.cs"/>
</Actions>
<Project language="C#">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ProjectItems>
<PropertyGroup>
<OutputType>WinExe</OutputType>
</PropertyGroup>
<Files>
<File name="NotificationIcon.cs" language="C#"><![CDATA[${StandardHeader.C#}
<!-- Template Header -->
<TemplateConfiguration>
<Name>${res:Templates.Project.SysTrayIcon.Name}</Name>
<Category>C#</Category>
<Subcategory>${res:Templates.File.Categories.WindowsApplications}</Subcategory>
<Icon>C#.Project.Form</Icon>
<Description>${res:Templates.Project.SysTrayIcon.Description}</Description>
<SupportedTargetFrameworks>v2.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->
<Actions>
<Open filename = "NotificationIcon.cs"/>
<RunCommand path = "/SharpDevelop/BackendBindings/TemplateCommands/AddDotNet35ReferencesIfTargetFrameworkIs35"/>
</Actions>
<Project language="C#">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ProjectItems>
<PropertyGroup>
<OutputType>WinExe</OutputType>
</PropertyGroup>
<Files>
<File name="NotificationIcon.cs" language="C#"><![CDATA[${StandardHeader.C#}
using System;
using System.Diagnostics;
using System.Drawing;
@ -111,9 +113,9 @@ namespace ${StandardNamespace} @@ -111,9 +113,9 @@ namespace ${StandardNamespace}
}
}
]]>
</File>
<File name="NotificationIcon.resx" src="NotifyIconResources.resx" buildAction="EmbeddedResource" DependentUpon="NotificationIcon.cs" />
<File name="AssemblyInfo.cs" src="DefaultAssemblyInfo.cs" />
</Files>
</Project>
</File>
<File name="NotificationIcon.resx" src="NotifyIconResources.resx" buildAction="EmbeddedResource" DependentUpon="NotificationIcon.cs" />
<File name="AssemblyInfo.cs" src="DefaultAssemblyInfo.cs" />
</Files>
</Project>
</Template>

2
data/templates/project/CSharp/Service.xpt

@ -10,11 +10,13 @@ @@ -10,11 +10,13 @@
<Subcategory>${res:Templates.File.Categories.WindowsApplications}</Subcategory>
<Icon>C#.Project.ServiceProject</Icon>
<Description>${res:Templates.Project.WindowsService.Description}</Description>
<SupportedTargetFrameworks>v2.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->
<Actions>
<Open filename = "${ProjectName}.cs"/>
<RunCommand path = "/SharpDevelop/BackendBindings/TemplateCommands/AddDotNet35ReferencesIfTargetFrameworkIs35"/>
</Actions>
<!-- Template Content -->

1
data/templates/project/CSharp/SharedAddin.xpt

@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
<Category>C#</Category>
<Icon>C#.Project.Library</Icon>
<Description>${res:Templates.Project.SharedAddin.Description}</Description>
<SupportedTargetFrameworks>v2.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->

5
data/templates/project/CSharp/SharpDevelopAddin.xpt

@ -1,7 +1,5 @@ @@ -1,7 +1,5 @@
<?xml version="1.0"?>
<Template originator = "Daniel Grunwald"
created = "26/04/2005"
lastModified = "26/04/2005">
<Template originator = "Daniel Grunwald" created = "26/04/2005">
<!-- Template Header -->
<TemplateConfiguration>
@ -10,6 +8,7 @@ @@ -10,6 +8,7 @@
<Subcategory>SharpDevelop</Subcategory>
<Icon>C#.Project.ControlLibrary</Icon>
<Description>${res:Templates.Project.SharpDevelopAddin.Description}</Description>
<SupportedTargetFrameworks>v2.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->

1
data/templates/project/CSharp/SharpDevelopCustomTool.xpt

@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
<Subcategory>SharpDevelop</Subcategory>
<Icon>C#.Project.ControlLibrary</Icon>
<Description>A custom tool that implements a code generator transforming a source file into an output file whenever the source is changed inside SharpDevelop</Description>
<SupportedTargetFrameworks>v2.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->

1
data/templates/project/CSharp/SharpDevelopMacro.xpt

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
<Subcategory>SharpDevelop</Subcategory>
<Icon>C#.Project.ControlLibrary</Icon>
<Description>${res:Templates.Project.SharpDevelopMacro.Description}</Description>
<SupportedTargetFrameworks>v2.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->

34
data/templates/project/CSharp/WPFApplication.xpt

@ -1,7 +1,5 @@ @@ -1,7 +1,5 @@
<?xml version="1.0"?>
<Template originator = "Mathias Simmack"
created = "26/10/2005"
lastModified = "02/06/2006">
<Template originator = "Mathias Simmack" created = "26/10/2005">
<!-- Template Header -->
<TemplateConfiguration>
@ -10,10 +8,13 @@ @@ -10,10 +8,13 @@
<Subcategory>.NET 3.0</Subcategory>
<Icon>C#.Project.Form</Icon>
<Description>${res:Templates.Project.WinFXApplication.Description}</Description>
<SupportedTargetFrameworks>v3.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->
<Actions>
<Open filename = "Window1.xaml"/>
<RunCommand path = "/SharpDevelop/BackendBindings/TemplateCommands/AddDotNet35ReferencesIfTargetFrameworkIs35"/>
</Actions>
<Project language = "C#">
@ -21,16 +22,15 @@ @@ -21,16 +22,15 @@
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="UIAutomationProvider" />
<Reference Include="UIAutomationTypes" />
<Reference Include="ReachFramework" />
<Reference Include="System.Printing" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.IdentityModel" />
<Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="PresentationFramework">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
</ProjectItems>
<PropertyGroup>
@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
</Application.Resources>
</Application>]]></File>
<File name="App.xaml.cs" SubType="Code" DependentUpon="App.xaml"><![CDATA[using System;
<File name="App.xaml.cs" SubType="Code" DependentUpon="App.xaml"><![CDATA[using System;
using System.Windows;
using System.Data;
using System.Xml;
@ -66,7 +66,7 @@ namespace ${StandardNamespace} @@ -66,7 +66,7 @@ namespace ${StandardNamespace}
}
}
}]]></File>
<File name="Window1.xaml" buildAction="Page" language="XML"><![CDATA[<Window x:Class="${StandardNamespace}.Window1"
<File name="Window1.xaml" buildAction="Page" language="XML"><![CDATA[<Window x:Class="${StandardNamespace}.Window1"
xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="${StandardNamespace}" Height="300" Width="300"
@ -75,7 +75,7 @@ namespace ${StandardNamespace} @@ -75,7 +75,7 @@ namespace ${StandardNamespace}
</Grid>
</Window>]]></File>
<File name="Window1.xaml.cs" SubType="Code" DependentUpon="Window1.xaml"><![CDATA[using System;
<File name="Window1.xaml.cs" SubType="Code" DependentUpon="Window1.xaml"><![CDATA[using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
@ -100,7 +100,7 @@ namespace ${StandardNamespace} @@ -100,7 +100,7 @@ namespace ${StandardNamespace}
}
}
}]]></File>
<File name="AssemblyInfo.cs" src="WPFAssemblyInfo.cs" />
<File name="AssemblyInfo.cs" src="WPFAssemblyInfo.cs" />
</Files>
</Project>
</Template>

38
data/templates/project/CSharp/WPFNavigationApplication.xpt

@ -1,7 +1,5 @@ @@ -1,7 +1,5 @@
<?xml version="1.0"?>
<Template originator = "Mathias Simmack"
created = "26/10/2005"
lastModified = "02/06/2006">
<Template originator = "Mathias Simmack" created = "26/10/2005">
<!-- Template Header -->
<TemplateConfiguration>
@ -10,29 +8,31 @@ @@ -10,29 +8,31 @@
<Subcategory>.NET 3.0</Subcategory>
<Icon>C#.Project.Form</Icon>
<Description>${res:Templates.Project.WinFXNavigationApplication.Description}</Description>
<SupportedTargetFrameworks>v3.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->
<Actions>
<Open filename = "Page1.xaml"/>
<RunCommand path = "/SharpDevelop/BackendBindings/TemplateCommands/AddDotNet35ReferencesIfTargetFrameworkIs35"/>
</Actions>
<Project language = "C#">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="UIAutomationProvider" />
<Reference Include="UIAutomationTypes" />
<Reference Include="ReachFramework" />
<Reference Include="System.Printing" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.IdentityModel" />
<Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="PresentationFramework">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
</ProjectItems>
<PropertyGroup>
<OutputType>WinExe</OutputType>
</PropertyGroup>
@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
</Application.Resources>
</Application>]]></File>
<File name="App.xaml.cs" SubType="Code" DependentUpon="App.xaml"><![CDATA[using System;
<File name="App.xaml.cs" SubType="Code" DependentUpon="App.xaml"><![CDATA[using System;
using System.Windows;
using System.Data;
using System.Xml;
@ -66,7 +66,7 @@ namespace ${StandardNamespace} @@ -66,7 +66,7 @@ namespace ${StandardNamespace}
}
}
}]]></File>
<File name="Page1.xaml" language="XML" buildAction="Page"><![CDATA[<Page x:Class="${StandardNamespace}.Page1"
<File name="Page1.xaml" language="XML" buildAction="Page"><![CDATA[<Page x:Class="${StandardNamespace}.Page1"
xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Page1"
@ -75,7 +75,7 @@ namespace ${StandardNamespace} @@ -75,7 +75,7 @@ namespace ${StandardNamespace}
</Grid>
</Page>]]></File>
<File name="Page1.xaml.cs" language="C#" DependentUpon="Page1.xaml" SubType="Code"><![CDATA[using System;
<File name="Page1.xaml.cs" language="C#" DependentUpon="Page1.xaml" SubType="Code"><![CDATA[using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
@ -101,7 +101,7 @@ namespace ${StandardNamespace} @@ -101,7 +101,7 @@ namespace ${StandardNamespace}
}
}
}]]></File>
<File name="AssemblyInfo.cs" src="WPFAssemblyInfo.cs" />
<File name="AssemblyInfo.cs" src="WPFAssemblyInfo.cs" />
</Files>
</Project>
</Template>

1
data/templates/project/ComplexExample.xpt.test

@ -19,7 +19,6 @@ @@ -19,7 +19,6 @@
</Actions>
<!-- Template Content -->
<!-- for compatibility reasons, the root node is allowed to be called either Solution or Combine -->
<Solution name = "${ProjectName}" directory = ".">
<!-- the startup project can be specified like this: -->

58
src/AddIns/BackendBindings/CSharpBinding/Project/Resources/BuildOptions.xfrm

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="cSharpBuildOptionsPanel" />
<ClientSize value="{Width=510, Height=684}" />
<ClientSize value="{Width=527, Height=684}" />
<AutoScroll value="True" />
<Controls>
<System.Windows.Forms.GroupBox>
@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
<Location value="3, 3" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.BuildOptions.General}" />
<Size value="504, 146" />
<Size value="521, 146" />
<Anchor value="Top, Left, Right" />
<TabIndex value="0" />
<Controls>
@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
<Location value="6, 16" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.BuildOptions.ConditionalSymbols}" />
<Size value="492, 16" />
<Size value="509, 16" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
<TabIndex value="0" />
@ -28,14 +28,14 @@ @@ -28,14 +28,14 @@
<TabIndex value="1" />
<Location value="6, 36" />
<Anchor value="Top, Left, Right" />
<Size value="492, 20" />
<Size value="509, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.CheckBox>
<Name value="optimizeCodeCheckBox" />
<Location value="6, 60" />
<Text value="${res:Dialog.ProjectOptions.BuildOptions.OptimizeCode}" />
<TabIndex value="2" />
<Size value="492, 21" />
<Size value="509, 21" />
<UseCompatibleTextRendering value="True" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.CheckBox>
@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
<Location value="6, 80" />
<Text value="${res:Dialog.ProjectOptions.BuildOptions.AllowUnsafeCode}" />
<TabIndex value="3" />
<Size value="492, 21" />
<Size value="509, 21" />
<UseCompatibleTextRendering value="True" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.CheckBox>
@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
<Location value="6, 100" />
<Text value="${res:Dialog.ProjectOptions.BuildOptions.CheckForOverflow}" />
<TabIndex value="4" />
<Size value="492, 21" />
<Size value="509, 21" />
<UseCompatibleTextRendering value="True" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.CheckBox>
@ -62,7 +62,7 @@ @@ -62,7 +62,7 @@
<Location value="6, 120" />
<Text value="${res:Dialog.ProjectOptions.BuildOptions.NoCorlib}" />
<TabIndex value="5" />
<Size value="492, 21" />
<Size value="509, 21" />
<UseCompatibleTextRendering value="True" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.CheckBox>
@ -73,13 +73,13 @@ @@ -73,13 +73,13 @@
<Location value="3, 152" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.Output}" />
<Size value="504, 362" />
<Size value="521, 362" />
<Anchor value="Top, Left, Right" />
<TabIndex value="1" />
<Controls>
<System.Windows.Forms.Button>
<Name value="convertProjectToMSBuild35Button" />
<Location value="316, 107" />
<Location value="337, 106" />
<Text value="Convert project to C# 3.0..." />
<UseVisualStyleBackColor value="True" />
<Size value="173, 23" />
@ -90,7 +90,7 @@ @@ -90,7 +90,7 @@
<Location value="12, 17" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.OutputPath}" />
<Size value="492, 16" />
<Size value="509, 16" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
<TabIndex value="3" />
@ -100,11 +100,11 @@ @@ -100,11 +100,11 @@
<TabIndex value="4" />
<Location value="12, 37" />
<Anchor value="Top, Left, Right" />
<Size value="448, 20" />
<Size value="465, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Button>
<Name value="outputPathBrowseButton" />
<Location value="464, 37" />
<Location value="481, 37" />
<UseCompatibleTextRendering value="True" />
<Text value="..." />
<Size value="40, 21" />
@ -124,7 +124,7 @@ @@ -124,7 +124,7 @@
<TabIndex value="7" />
<Location value="170, 61" />
<Anchor value="Top, Left, Right" />
<Size value="333, 20" />
<Size value="350, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="debugInfoLabel" />
@ -139,7 +139,7 @@ @@ -139,7 +139,7 @@
<Name value="debugInfoComboBox" />
<TabIndex value="9" />
<Location value="170, 85" />
<Size value="140, 21" />
<Size value="161, 21" />
<DropDownStyle value="DropDownList" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.Label>
@ -155,7 +155,7 @@ @@ -155,7 +155,7 @@
<Name value="targetFrameworkComboBox" />
<TabIndex value="11" />
<Location value="170, 109" />
<Size value="140, 21" />
<Size value="161, 21" />
<DropDownStyle value="DropDownList" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.GroupBox>
@ -163,7 +163,7 @@ @@ -163,7 +163,7 @@
<Location value="6, 136" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.Advanced}" />
<Size value="492, 220" />
<Size value="509, 220" />
<Anchor value="Top, Left, Right" />
<TabIndex value="9" />
<Controls>
@ -171,7 +171,7 @@ @@ -171,7 +171,7 @@
<Name value="platformSpecificOptionsPanel" />
<Location value="6, 14" />
<TabIndex value="9" />
<Size value="480, 121" />
<Size value="497, 121" />
<Anchor value="Top, Left, Right" />
<Controls>
<System.Windows.Forms.Label>
@ -203,7 +203,7 @@ @@ -203,7 +203,7 @@
<Location value="177, 1" />
<Text value="${res:Dialog.ProjectOptions.Build.RegisterForCOM}" />
<TabIndex value="0" />
<Size value="300, 21" />
<Size value="317, 21" />
<UseCompatibleTextRendering value="True" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.CheckBox>
@ -256,7 +256,7 @@ @@ -256,7 +256,7 @@
<Location value="6, 134" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.BaseIntermediateOutputPath}" />
<Size value="480, 16" />
<Size value="497, 16" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
<TabIndex value="0" />
@ -266,11 +266,11 @@ @@ -266,11 +266,11 @@
<TabIndex value="1" />
<Location value="6, 153" />
<Anchor value="Top, Left, Right" />
<Size value="429, 20" />
<Size value="446, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Button>
<Name value="baseIntermediateOutputPathBrowseButton" />
<Location value="446, 153" />
<Location value="463, 153" />
<UseCompatibleTextRendering value="True" />
<Text value="..." />
<Size value="40, 21" />
@ -282,7 +282,7 @@ @@ -282,7 +282,7 @@
<Location value="6, 177" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.IntermediateOutputPath}" />
<Size value="480, 16" />
<Size value="497, 16" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
<TabIndex value="0" />
@ -292,11 +292,11 @@ @@ -292,11 +292,11 @@
<TabIndex value="1" />
<Location value="6, 193" />
<Anchor value="Top, Left, Right" />
<Size value="429, 20" />
<Size value="446, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Button>
<Name value="intermediateOutputPathBrowseButton" />
<Location value="446, 192" />
<Location value="463, 192" />
<UseCompatibleTextRendering value="True" />
<Text value="..." />
<Size value="40, 21" />
@ -312,7 +312,7 @@ @@ -312,7 +312,7 @@
<Location value="3, 518" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.ErrorsAndWarnings}" />
<Size value="504, 66" />
<Size value="521, 66" />
<Anchor value="Top, Left, Right" />
<TabIndex value="2" />
<Controls>
@ -347,7 +347,7 @@ @@ -347,7 +347,7 @@
<TabIndex value="3" />
<Location value="164, 40" />
<Anchor value="Top, Left, Right" />
<Size value="333, 20" />
<Size value="350, 20" />
</System.Windows.Forms.TextBox>
</Controls>
</System.Windows.Forms.GroupBox>
@ -356,7 +356,7 @@ @@ -356,7 +356,7 @@
<Location value="3, 588" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.TreatWarningsAsErrors}" />
<Size value="504, 92" />
<Size value="521, 92" />
<Anchor value="Top, Left, Right" />
<TabIndex value="3" />
<Controls>
@ -389,7 +389,7 @@ @@ -389,7 +389,7 @@
<TabIndex value="2" />
<Location value="164, 42" />
<Anchor value="Top, Left, Right" />
<Size value="334, 20" />
<Size value="351, 20" />
</System.Windows.Forms.TextBox>
</Controls>
</System.Windows.Forms.GroupBox>

3
src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.cs

@ -23,8 +23,7 @@ namespace CSharpBinding.OptionPanels @@ -23,8 +23,7 @@ namespace CSharpBinding.OptionPanels
InitIntermediateOutputPath();
InitOutputPath();
InitXmlDoc();
InitTargetFramework(CSharpProject.DefaultTargetsFile,
CSharpProject.ExtendedTargetsFile);
InitTargetFramework();
ConfigurationGuiBinding b;

36
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpProject.cs

@ -63,8 +63,12 @@ namespace CSharpBinding @@ -63,8 +63,12 @@ namespace CSharpBinding
protected override void Create(ProjectCreateInformation information)
{
base.Create(information);
this.AddImport(DefaultTargetsFile, null);
// Add import before base.Create call - base.Create will call AddOrRemoveExtensions, which
// needs to change the import when the compact framework is targeted.
base.Create(information);
SetProperty("Debug", null, "CheckForOverflowUnderflow", "True",
PropertyStorageLocations.ConfigurationSpecific, true);
SetProperty("Release", null, "CheckForOverflowUnderflow", "False",
@ -97,10 +101,34 @@ namespace CSharpBinding @@ -97,10 +101,34 @@ namespace CSharpBinding
}
}
public override void ConvertToMSBuild35(bool changeTargetFrameworkToNet35)
protected override void AddOrRemoveExtensions()
{
base.ConvertToMSBuild35(changeTargetFrameworkToNet35);
ConvertToMSBuild35(changeTargetFrameworkToNet35, DefaultTargetsFile, ExtendedTargetsFile);
// Test if SharpDevelop-Build extensions are required
bool needExtensions = false;
foreach (var p in GetAllProperties("TargetFrameworkVersion")) {
if (p.IsImported == false) {
if (p.Value.StartsWith("CF") || p.Value.StartsWith("Mono")) {
needExtensions = true;
}
}
}
foreach (Microsoft.Build.BuildEngine.Import import in MSBuildProject.Imports) {
if (needExtensions) {
if (DefaultTargetsFile.Equals(import.ProjectPath, StringComparison.InvariantCultureIgnoreCase)) {
//import.ProjectPath = extendedTargets;
MSBuildInternals.SetImportProjectPath(this, import, ExtendedTargetsFile);
break;
}
} else {
if (ExtendedTargetsFile.Equals(import.ProjectPath, StringComparison.InvariantCultureIgnoreCase)) {
//import.ProjectPath = defaultTargets;
MSBuildInternals.SetImportProjectPath(this, import, DefaultTargetsFile);
break;
}
}
}
}
}
}

3
src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/BuildOptions.cs

@ -50,8 +50,7 @@ namespace VBNetBinding.OptionPanels @@ -50,8 +50,7 @@ namespace VBNetBinding.OptionPanels
InitIntermediateOutputPath();
InitOutputPath();
InitXmlDoc();
InitTargetFramework(VBNetProject.DefaultTargetsFile,
VBNetProject.ExtendedTargetsFile);
InitTargetFramework();
InitDebugInfo();
InitAdvanced();

37
src/AddIns/BackendBindings/VBNetBinding/Project/Src/Project/VBNetProject.cs

@ -63,14 +63,17 @@ namespace VBNetBinding @@ -63,14 +63,17 @@ namespace VBNetBinding
: base(info.Solution)
{
InitVB();
this.AddImport(DefaultTargetsFile, null);
// Add import before Create call - base.Create will call AddOrRemoveExtensions, which
// needs to change the import when the compact framework is targeted.
Create(info);
SetProperty("Debug", null, "DefineConstants", "DEBUG=1,TRACE=1",
PropertyStorageLocations.ConfigurationSpecific, true);
SetProperty("Release", null, "DefineConstants", "TRACE=1",
PropertyStorageLocations.ConfigurationSpecific, true);
this.AddImport(DefaultTargetsFile, null);
}
protected override ParseProjectContent CreateProjectContent()
@ -119,10 +122,34 @@ namespace VBNetBinding @@ -119,10 +122,34 @@ namespace VBNetBinding
}
}
public override void ConvertToMSBuild35(bool changeTargetFrameworkToNet35)
protected override void AddOrRemoveExtensions()
{
base.ConvertToMSBuild35(changeTargetFrameworkToNet35);
ConvertToMSBuild35(changeTargetFrameworkToNet35, DefaultTargetsFile, ExtendedTargetsFile);
// Test if SharpDevelop-Build extensions are required
bool needExtensions = false;
foreach (var p in GetAllProperties("TargetFrameworkVersion")) {
if (p.IsImported == false) {
if (p.Value.StartsWith("CF") || p.Value.StartsWith("Mono")) {
needExtensions = true;
}
}
}
foreach (Microsoft.Build.BuildEngine.Import import in MSBuildProject.Imports) {
if (needExtensions) {
if (DefaultTargetsFile.Equals(import.ProjectPath, StringComparison.InvariantCultureIgnoreCase)) {
//import.ProjectPath = extendedTargets;
MSBuildInternals.SetImportProjectPath(this, import, ExtendedTargetsFile);
break;
}
} else {
if (ExtendedTargetsFile.Equals(import.ProjectPath, StringComparison.InvariantCultureIgnoreCase)) {
//import.ProjectPath = defaultTargets;
MSBuildInternals.SetImportProjectPath(this, import, DefaultTargetsFile);
break;
}
}
}
}
}
}

4
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextEditorControlBase.cs

@ -139,7 +139,6 @@ namespace ICSharpCode.TextEditor @@ -139,7 +139,6 @@ namespace ICSharpCode.TextEditor
/// If set to true the contents can't be altered.
/// </value>
[Browsable(false)]
[ReadOnly(true)]
public bool IsReadOnly {
get {
return Document.ReadOnly;
@ -701,6 +700,9 @@ namespace ICSharpCode.TextEditor @@ -701,6 +700,9 @@ namespace ICSharpCode.TextEditor
foreach (LineSegment line in Document.LineSegmentCollection) {
streamWriter.Write(Document.GetText(line.Offset, line.Length));
if (line.DelimiterLength > 0) {
char charAfterLine = Document.GetCharAt(line.Offset + line.Length);
if (charAfterLine != '\n' && charAfterLine != '\r')
throw new InvalidOperationException("The document cannot be saved because it is corrupted.");
// only save line terminator if the line has one
streamWriter.Write(document.TextEditorProperties.LineTerminator);
}

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

@ -67,6 +67,10 @@ @@ -67,6 +67,10 @@
<Compile Include="Src\Gui\Dialogs\AsynchronousWaitDialog.Designer.cs">
<DependentUpon>AsynchronousWaitDialog.cs</DependentUpon>
</Compile>
<Compile Include="Src\Gui\Dialogs\NewProjectDialog.cs" />
<Compile Include="Src\Gui\Dialogs\NewProjectDialog.Designer.cs">
<DependentUpon>NewProjectDialog.cs</DependentUpon>
</Compile>
<Compile Include="Src\Gui\Dialogs\OpenWithDialog.cs" />
<Compile Include="Src\Gui\Dialogs\OpenWithDialog.Designer.cs">
<DependentUpon>OpenWithDialog.cs</DependentUpon>
@ -343,9 +347,6 @@ @@ -343,9 +347,6 @@
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Pads\ProjectBrowser\ProjectBrowserPad.cs" />
<Compile Include="Src\Gui\Dialogs\NewProjectDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Project\Items\ProjectReferenceProjectItem.cs" />
<Compile Include="Src\Gui\Pads\ProjectBrowser\TreeNodes\DirectoryNode.cs" />
<Compile Include="Src\Gui\Pads\ProjectBrowser\TreeNodes\FileNode.cs" />
@ -433,7 +434,6 @@ @@ -433,7 +434,6 @@
<EmbeddedResource Include="Resources\InputBox.xfrm" />
<EmbeddedResource Include="Resources\LoadSaveOptionPanel.xfrm" />
<EmbeddedResource Include="Resources\NewFileDialog.xfrm" />
<EmbeddedResource Include="Resources\NewProjectDialog.xfrm" />
<EmbeddedResource Include="Resources\OutputWindowOptionsPanel.xfrm" />
<EmbeddedResource Include="Resources\SelectStylePanel.xfrm" />
<EmbeddedResource Include="Resources\TabbedOptionsDialog.xfrm" />
@ -695,6 +695,9 @@ @@ -695,6 +695,9 @@
<Compile Include="Src\Internal\Templates\TemplateLoadException.cs" />
<Compile Include="Src\Util\UnclosableStream.cs" />
<EmbeddedResource Include="Resources\DefaultManifest.manifest" />
<EmbeddedResource Include="Src\Gui\Dialogs\NewProjectDialog.resx">
<DependentUpon>NewProjectDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ConvertToMSBuild35Dialog.resx">
<DependentUpon>ConvertToMSBuild35Dialog.cs</DependentUpon>
</EmbeddedResource>

1
src/Main/Base/Project/Resources/GotoDialog.xfrm

@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
<Size value="{Width=372, Height=106}" />
<TabIndex value="5" />
<MultiSelect value="False" />
<HoverSelection value="True" />
<View value="Details" />
<HeaderStyle value="None" />
<Activation value="OneClick" />

1
src/Main/Base/Project/Resources/NewFileDialog.xfrm

@ -58,7 +58,6 @@ @@ -58,7 +58,6 @@
<TabIndex value="1" />
<Location value="{X=0,Y=23}" />
<Size value="{Width=346, Height=267}" />
<HoverSelection value="True" />
<HideSelection value="False" />
</System.Windows.Forms.ListView>
<System.Windows.Forms.Panel>

1
src/Main/Base/Project/Resources/NewFileWithNameDialog.xfrm

@ -75,7 +75,6 @@ @@ -75,7 +75,6 @@
<TabIndex value="1" />
<Location value="{X=0,Y=23}" />
<Size value="{Width=381, Height=257}" />
<HoverSelection value="True" />
<HideSelection value="False" />
</System.Windows.Forms.ListView>
<System.Windows.Forms.Panel>

226
src/Main/Base/Project/Resources/NewProjectDialog.xfrm

@ -1,226 +0,0 @@ @@ -1,226 +0,0 @@
<Components version="1.0">
<System.Windows.Forms.Form>
<Name value="MyForm" />
<ShowInTaskbar value="False" />
<FormBorderStyle value="FixedDialog" />
<ClientSize value="{Width=522, Height=448}" />
<MinimizeBox value="False" />
<DockPadding value="" />
<Text value="${res:Dialog.NewProject.DialogName}" />
<AcceptButton value="openButton [System.Windows.Forms.Button], Text: ${res:Global.CreateButtonText}" />
<CancelButton value="cancelButton [System.Windows.Forms.Button], Text: ${res:Global.CancelButtonText}" />
<MaximizeBox value="False" />
<Controls>
<System.Windows.Forms.CheckBox>
<Name value="autoCreateSubDirCheckBox" />
<Location value="{X=284,Y=367}" />
<Checked value="True" />
<Size value="{Width=232, Height=21}" />
<Text value="${res:Dialog.NewProject.autoCreateSubDirCheckBox}" />
<CheckState value="Checked" />
<Anchor value="Bottom, Right" />
<TabIndex value="14" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.Label>
<Name value="createInLabel" />
<Text value="label6" />
<Anchor value="Bottom, Left, Right" />
<TabIndex value="13" />
<Size value="{Width=508, Height=21}" />
<Location value="{X=8,Y=391}" />
</System.Windows.Forms.Label>
<System.Windows.Forms.CheckBox>
<Name value="createSeparateDirCheckBox" />
<Location value="{X=284,Y=340}" />
<Size value="{Width=232, Height=28}" />
<Text value="${res:Dialog.NewProject.checkBox1Text}" />
<Anchor value="Bottom, Right" />
<TabIndex value="12" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.Label>
<Name value="label5" />
<Text value="${res:Dialog.NewProject.NewSolutionLabelText}" />
<TextAlign value="MiddleRight" />
<Anchor value="Bottom, Left" />
<TabIndex value="11" />
<Size value="{Width=128, Height=23}" />
<Location value="{X=0,Y=343}" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="solutionNameTextBox" />
<Anchor value="Bottom, Left, Right" />
<TabIndex value="10" />
<Location value="{X=128,Y=343}" />
<Size value="{Width=152, Height=21}" />
<Text value="" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Button>
<Name value="browseButton" />
<Location value="{X=484,Y=319}" />
<Size value="{Width=32, Height=21}" />
<Text value="..." />
<Anchor value="Bottom, Right" />
<TabIndex value="9" />
</System.Windows.Forms.Button>
<System.Windows.Forms.TextBox>
<Name value="locationTextBox" />
<Anchor value="Bottom, Left, Right" />
<TabIndex value="7" />
<Location value="{X=128,Y=319}" />
<Size value="{Width=352, Height=21}" />
<Text value="" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="label4" />
<Text value="${res:Dialog.NewProject.LocationLabelText}" />
<TextAlign value="MiddleRight" />
<Anchor value="Bottom, Left" />
<TabIndex value="6" />
<Size value="{Width=128, Height=23}" />
<Location value="{X=0,Y=320}" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="nameTextBox" />
<Anchor value="Bottom, Left, Right" />
<TabIndex value="5" />
<Location value="{X=128,Y=295}" />
<Size value="{Width=388, Height=21}" />
<Text value="" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="label3" />
<Text value="${res:Dialog.NewProject.NameLabelText}" />
<TextAlign value="MiddleRight" />
<Anchor value="Bottom, Left" />
<TabIndex value="4" />
<Size value="{Width=128, Height=23}" />
<Location value="{X=0,Y=295}" />
</System.Windows.Forms.Label>
<System.Windows.Forms.Label>
<Name value="descriptionLabel" />
<TextAlign value="MiddleLeft" />
<Anchor value="Bottom, Left, Right" />
<TabIndex value="1" />
<Size value="{Width=508, Height=19}" />
<Location value="{X=8,Y=263}" />
<BorderStyle value="Fixed3D" />
</System.Windows.Forms.Label>
<System.Windows.Forms.Button>
<Name value="cancelButton" />
<Location value="{X=440,Y=418}" />
<Text value="${res:Global.CancelButtonText}" />
<Anchor value="Bottom, Right" />
<TabIndex value="3" />
<DialogResult value="Cancel" />
</System.Windows.Forms.Button>
<System.Windows.Forms.Button>
<Name value="openButton" />
<Location value="{X=360,Y=418}" />
<Text value="${res:Global.CreateButtonText}" />
<Anchor value="Bottom, Right" />
<TabIndex value="2" />
</System.Windows.Forms.Button>
<System.Windows.Forms.Panel>
<Name value="backgroundPanel" />
<Location value="{X=8,Y=8}" />
<Size value="{Width=508, Height=247}" />
<DockPadding value="" />
<Anchor value="Top, Bottom, Left, Right" />
<TabIndex value="0" />
<Controls>
<System.Windows.Forms.Panel>
<Name value="templatePanel" />
<Location value="{X=127,Y=0}" />
<Size value="{Width=381, Height=247}" />
<DockPadding value="" />
<TabIndex value="2" />
<Dock value="Fill" />
<Controls>
<System.Windows.Forms.ListView>
<Name value="templateListView" />
<Dock value="Fill" />
<MultiSelect value="False" />
<TabIndex value="1" />
<Location value="{X=0,Y=23}" />
<Size value="{Width=381, Height=224}" />
<HoverSelection value="True" />
<HideSelection value="False" />
</System.Windows.Forms.ListView>
<System.Windows.Forms.Panel>
<Name value="panel2" />
<Location value="{X=0,Y=0}" />
<Size value="{Width=381, Height=23}" />
<DockPadding value="" />
<TabIndex value="4" />
<Dock value="Top" />
<Controls>
<System.Windows.Forms.Label>
<Name value="label2" />
<Text value="${res:Dialog.NewProject.TemplateLabelText}" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
<TabIndex value="0" />
<Size value="{Width=312, Height=23}" />
<Location value="{X=0,Y=0}" />
</System.Windows.Forms.Label>
<System.Windows.Forms.RadioButton>
<Name value="largeIconsRadioButton" />
<Location value="{X=358,Y=0}" />
<Size value="{Width=22, Height=22}" />
<Anchor value="Top, Right" />
<TabIndex value="3" />
<Appearance value="Button" />
</System.Windows.Forms.RadioButton>
<System.Windows.Forms.RadioButton>
<Name value="smallIconsRadioButton" />
<Location value="{X=334,Y=0}" />
<Size value="{Width=22, Height=22}" />
<Anchor value="Top, Right" />
<TabIndex value="2" />
<Appearance value="Button" />
</System.Windows.Forms.RadioButton>
</Controls>
</System.Windows.Forms.Panel>
</Controls>
</System.Windows.Forms.Panel>
<System.Windows.Forms.Splitter>
<Name value="splitter" />
<TabIndex value="1" />
<Size value="{Width=3, Height=247}" />
<Location value="{X=174,Y=0}" />
</System.Windows.Forms.Splitter>
<System.Windows.Forms.Panel>
<Name value="categoryPanel" />
<Location value="{X=0,Y=0}" />
<Size value="{Width=174, Height=247}" />
<DockPadding value="" />
<TabIndex value="0" />
<Dock value="Left" />
<Controls>
<System.Windows.Forms.TreeView>
<Name value="categoryTreeView" />
<ImageIndex value="-1" />
<Dock value="Fill" />
<TabIndex value="1" />
<Location value="{X=0,Y=23}" />
<SelectedImageIndex value="-1" />
<Size value="{Width=174, Height=224}" />
<HotTracking value="True" />
<HideSelection value="False" />
</System.Windows.Forms.TreeView>
<System.Windows.Forms.Label>
<Name value="label" />
<Text value="${res:Dialog.NewProject.ProjectTypeLabelText}" />
<TextAlign value="BottomLeft" />
<TabIndex value="0" />
<Size value="{Width=174, Height=23}" />
<Location value="{X=0,Y=0}" />
<Dock value="Top" />
</System.Windows.Forms.Label>
</Controls>
</System.Windows.Forms.Panel>
</Controls>
</System.Windows.Forms.Panel>
</Controls>
</System.Windows.Forms.Form>
</Components>

338
src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.Designer.cs generated

@ -0,0 +1,338 @@ @@ -0,0 +1,338 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <author name="Daniel Grunwald"/>
// <version>$Revision$</version>
// </file>
namespace ICSharpCode.SharpDevelop.Project.Dialogs
{
partial class NewProjectDialog
{
/// <summary>
/// Designer variable used to keep track of non-visual components.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Disposes resources used by the form.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.categoryTreeView = new System.Windows.Forms.TreeView();
this.label1 = new System.Windows.Forms.Label();
this.templateListView = new System.Windows.Forms.ListView();
this.largeIconsRadioButton = new System.Windows.Forms.RadioButton();
this.smallIconsRadioButton = new System.Windows.Forms.RadioButton();
this.targetFrameworkComboBox = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.bottomPanel = new System.Windows.Forms.Panel();
this.cancelButton = new System.Windows.Forms.Button();
this.openButton = new System.Windows.Forms.Button();
this.createInLabel = new System.Windows.Forms.Label();
this.createDirectoryForSolutionCheckBox = new System.Windows.Forms.CheckBox();
this.browseButton = new System.Windows.Forms.Button();
this.solutionNameTextBox = new System.Windows.Forms.TextBox();
this.locationTextBox = new System.Windows.Forms.TextBox();
this.solutionNameLabel = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.nameTextBox = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.descriptionLabel = new System.Windows.Forms.Label();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.bottomPanel.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.categoryTreeView);
this.splitContainer1.Panel1.Controls.Add(this.label1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.templateListView);
this.splitContainer1.Panel2.Controls.Add(this.largeIconsRadioButton);
this.splitContainer1.Panel2.Controls.Add(this.smallIconsRadioButton);
this.splitContainer1.Panel2.Controls.Add(this.targetFrameworkComboBox);
this.splitContainer1.Panel2.Controls.Add(this.label2);
this.splitContainer1.Size = new System.Drawing.Size(571, 258);
this.splitContainer1.SplitterDistance = 189;
this.splitContainer1.TabIndex = 0;
//
// categoryTreeView
//
this.categoryTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.categoryTreeView.HideSelection = false;
this.categoryTreeView.Location = new System.Drawing.Point(3, 26);
this.categoryTreeView.Name = "categoryTreeView";
this.categoryTreeView.Size = new System.Drawing.Size(183, 232);
this.categoryTreeView.TabIndex = 1;
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(183, 23);
this.label1.TabIndex = 0;
this.label1.Text = "${res:Dialog.NewProject.ProjectTypeLabelText}";
this.label1.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// templateListView
//
this.templateListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.templateListView.HideSelection = false;
this.templateListView.Location = new System.Drawing.Point(3, 26);
this.templateListView.Name = "templateListView";
this.templateListView.Size = new System.Drawing.Size(368, 232);
this.templateListView.TabIndex = 4;
this.templateListView.UseCompatibleStateImageBehavior = false;
//
// largeIconsRadioButton
//
this.largeIconsRadioButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.largeIconsRadioButton.Appearance = System.Windows.Forms.Appearance.Button;
this.largeIconsRadioButton.Location = new System.Drawing.Point(349, 4);
this.largeIconsRadioButton.Name = "largeIconsRadioButton";
this.largeIconsRadioButton.Size = new System.Drawing.Size(22, 22);
this.largeIconsRadioButton.TabIndex = 2;
//
// smallIconsRadioButton
//
this.smallIconsRadioButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.smallIconsRadioButton.Appearance = System.Windows.Forms.Appearance.Button;
this.smallIconsRadioButton.Location = new System.Drawing.Point(325, 4);
this.smallIconsRadioButton.Name = "smallIconsRadioButton";
this.smallIconsRadioButton.Size = new System.Drawing.Size(22, 22);
this.smallIconsRadioButton.TabIndex = 1;
//
// targetFrameworkComboBox
//
this.targetFrameworkComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.targetFrameworkComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.targetFrameworkComboBox.Location = new System.Drawing.Point(158, 3);
this.targetFrameworkComboBox.Name = "targetFrameworkComboBox";
this.targetFrameworkComboBox.Size = new System.Drawing.Size(161, 21);
this.targetFrameworkComboBox.TabIndex = 0;
this.targetFrameworkComboBox.SelectedIndexChanged += new System.EventHandler(this.TargetFrameworkComboBoxSelectedIndexChanged);
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label2.Location = new System.Drawing.Point(3, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(149, 23);
this.label2.TabIndex = 3;
this.label2.Text = "${res:Dialog.NewProject.TemplateLabelText}";
this.label2.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// bottomPanel
//
this.bottomPanel.Controls.Add(this.cancelButton);
this.bottomPanel.Controls.Add(this.openButton);
this.bottomPanel.Controls.Add(this.createInLabel);
this.bottomPanel.Controls.Add(this.createDirectoryForSolutionCheckBox);
this.bottomPanel.Controls.Add(this.browseButton);
this.bottomPanel.Controls.Add(this.solutionNameTextBox);
this.bottomPanel.Controls.Add(this.locationTextBox);
this.bottomPanel.Controls.Add(this.solutionNameLabel);
this.bottomPanel.Controls.Add(this.label4);
this.bottomPanel.Controls.Add(this.nameTextBox);
this.bottomPanel.Controls.Add(this.label3);
this.bottomPanel.Controls.Add(this.descriptionLabel);
this.bottomPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
this.bottomPanel.Location = new System.Drawing.Point(0, 258);
this.bottomPanel.Name = "bottomPanel";
this.bottomPanel.Size = new System.Drawing.Size(571, 167);
this.bottomPanel.TabIndex = 1;
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(484, 132);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 23);
this.cancelButton.TabIndex = 11;
this.cancelButton.Text = "${res:Global.CancelButtonText}";
//
// openButton
//
this.openButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.openButton.Enabled = false;
this.openButton.Location = new System.Drawing.Point(404, 132);
this.openButton.Name = "openButton";
this.openButton.Size = new System.Drawing.Size(75, 23);
this.openButton.TabIndex = 10;
this.openButton.Text = "${res:Global.CreateButtonText}";
//
// createInLabel
//
this.createInLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.createInLabel.Location = new System.Drawing.Point(9, 113);
this.createInLabel.Name = "createInLabel";
this.createInLabel.Size = new System.Drawing.Size(550, 21);
this.createInLabel.TabIndex = 9;
this.createInLabel.Text = "label6";
//
// createDirectoryForSolutionCheckBox
//
this.createDirectoryForSolutionCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.createDirectoryForSolutionCheckBox.Location = new System.Drawing.Point(362, 88);
this.createDirectoryForSolutionCheckBox.Name = "createDirectoryForSolutionCheckBox";
this.createDirectoryForSolutionCheckBox.Size = new System.Drawing.Size(197, 24);
this.createDirectoryForSolutionCheckBox.TabIndex = 8;
this.createDirectoryForSolutionCheckBox.Text = "Create &directory for solution";
this.createDirectoryForSolutionCheckBox.UseVisualStyleBackColor = true;
//
// browseButton
//
this.browseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.browseButton.Location = new System.Drawing.Point(527, 62);
this.browseButton.Name = "browseButton";
this.browseButton.Size = new System.Drawing.Size(32, 21);
this.browseButton.TabIndex = 5;
this.browseButton.Text = "...";
//
// solutionNameTextBox
//
this.solutionNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.solutionNameTextBox.Location = new System.Drawing.Point(137, 90);
this.solutionNameTextBox.Name = "solutionNameTextBox";
this.solutionNameTextBox.Size = new System.Drawing.Size(219, 20);
this.solutionNameTextBox.TabIndex = 7;
//
// locationTextBox
//
this.locationTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.locationTextBox.Location = new System.Drawing.Point(137, 62);
this.locationTextBox.Name = "locationTextBox";
this.locationTextBox.Size = new System.Drawing.Size(384, 20);
this.locationTextBox.TabIndex = 4;
//
// solutionNameLabel
//
this.solutionNameLabel.Location = new System.Drawing.Point(9, 85);
this.solutionNameLabel.Name = "solutionNameLabel";
this.solutionNameLabel.Size = new System.Drawing.Size(128, 23);
this.solutionNameLabel.TabIndex = 6;
this.solutionNameLabel.Text = "Solution Na&me:";
this.solutionNameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label4
//
this.label4.Location = new System.Drawing.Point(9, 63);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(128, 23);
this.label4.TabIndex = 3;
this.label4.Text = "${res:Dialog.NewProject.LocationLabelText}";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// nameTextBox
//
this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.nameTextBox.Location = new System.Drawing.Point(137, 38);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(384, 20);
this.nameTextBox.TabIndex = 2;
this.nameTextBox.TextChanged += new System.EventHandler(this.NameTextBoxTextChanged);
//
// label3
//
this.label3.Location = new System.Drawing.Point(9, 38);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(128, 23);
this.label3.TabIndex = 1;
this.label3.Text = "${res:Dialog.NewProject.NameLabelText}";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// descriptionLabel
//
this.descriptionLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.descriptionLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.descriptionLabel.Location = new System.Drawing.Point(3, 3);
this.descriptionLabel.Name = "descriptionLabel";
this.descriptionLabel.Size = new System.Drawing.Size(561, 23);
this.descriptionLabel.TabIndex = 0;
this.descriptionLabel.Text = "label3";
//
// NewProjectDialog
//
this.AcceptButton = this.openButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(571, 425);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.bottomPanel);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "NewProjectDialog";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "${res:Dialog.NewProject.DialogName}";
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
this.bottomPanel.ResumeLayout(false);
this.bottomPanel.PerformLayout();
this.ResumeLayout(false);
}
private System.Windows.Forms.Panel bottomPanel;
private System.Windows.Forms.Label solutionNameLabel;
private System.Windows.Forms.CheckBox createDirectoryForSolutionCheckBox;
private System.Windows.Forms.ListView templateListView;
private System.Windows.Forms.TextBox solutionNameTextBox;
private System.Windows.Forms.TreeView categoryTreeView;
private System.Windows.Forms.Button openButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Label createInLabel;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox locationTextBox;
private System.Windows.Forms.Button browseButton;
private System.Windows.Forms.Label descriptionLabel;
private System.Windows.Forms.ComboBox targetFrameworkComboBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.RadioButton smallIconsRadioButton;
private System.Windows.Forms.RadioButton largeIconsRadioButton;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.SplitContainer splitContainer1;
}
}

267
src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <author name="Daniel Grunwald"/>
// <version>$Revision$</version>
// </file>
@ -21,10 +21,9 @@ using ICSharpCode.SharpDevelop.Internal.Templates; @@ -21,10 +21,9 @@ using ICSharpCode.SharpDevelop.Internal.Templates;
namespace ICSharpCode.SharpDevelop.Project.Dialogs
{
/// <summary>
/// This class displays a new project dialog and sets up and creates a a new project,
/// the project types are described in an XML options file
/// Description of NewProjectDialog.
/// </summary>
public class NewProjectDialog : BaseSharpDevelopForm
public partial class NewProjectDialog : Form
{
protected List<TemplateItem> alltemplates = new List<TemplateItem>();
protected List<Category> categories = new List<Category>();
@ -35,27 +34,20 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -35,27 +34,20 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
protected bool createNewSolution;
public string InitialProjectLocationDirectory {
get {
return ((TextBox)ControlDictionary["locationTextBox"]).Text;
}
set {
((TextBox)ControlDictionary["locationTextBox"]).Text = value;
}
get { return locationTextBox.Text; }
set { locationTextBox.Text = value; }
}
public NewProjectDialog(bool createNewSolution)
{
StandardHeader.SetHeaders();
this.createNewSolution = createNewSolution;
InitializeComponents();
MyInitializeComponents();
InitializeTemplates();
InitializeView();
((TreeView)ControlDictionary["categoryTreeView"]).Select();
((TextBox)ControlDictionary["locationTextBox"]).Text = PropertyService.Get("ICSharpCode.SharpDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath", Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "SharpDevelop Projects"));
StartPosition = FormStartPosition.CenterParent;
Icon = null;
locationTextBox.Text = PropertyService.Get("ICSharpCode.SharpDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath", Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "SharpDevelop Projects"));
}
protected virtual void InitializeView()
@ -97,20 +89,20 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -97,20 +89,20 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
}
}
((ListView)ControlDictionary["templateListView"]).LargeImageList = imglist;
((ListView)ControlDictionary["templateListView"]).SmallImageList = smalllist;
templateListView.LargeImageList = imglist;
templateListView.SmallImageList = smalllist;
InsertCategories(null, categories);
((TreeView)ControlDictionary["categoryTreeView"]).TreeViewNodeSorter = new TemplateCategoryComparer();
((TreeView)ControlDictionary["categoryTreeView"]).Sort();
SelectLastSelectedCategoryNode(((TreeView)ControlDictionary["categoryTreeView"]).Nodes, PropertyService.Get("Dialogs.NewProjectDialog.LastSelectedCategory", "C#"));
categoryTreeView.TreeViewNodeSorter = new TemplateCategoryComparer();
categoryTreeView.Sort();
SelectLastSelectedCategoryNode(categoryTreeView.Nodes, PropertyService.Get("Dialogs.NewProjectDialog.LastSelectedCategory", "C#"));
}
void InsertCategories(TreeNode node, IEnumerable<Category> catarray)
{
foreach (Category cat in catarray) {
if (node == null) {
((TreeView)ControlDictionary["categoryTreeView"]).Nodes.Add(cat);
categoryTreeView.Nodes.Add(cat);
} else {
node.Nodes.Add(cat);
}
@ -171,10 +163,46 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -171,10 +163,46 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
protected void CategoryChange(object sender, TreeViewEventArgs e)
{
((ListView)ControlDictionary["templateListView"]).Items.Clear();
if (((TreeView)ControlDictionary["categoryTreeView"]).SelectedNode != null) {
foreach (TemplateItem item in ((Category)((TreeView)ControlDictionary["categoryTreeView"]).SelectedNode).Templates) {
((ListView)ControlDictionary["templateListView"]).Items.Add(item);
targetFrameworkComboBox.SelectedIndexChanged -= TargetFrameworkComboBoxSelectedIndexChanged;
targetFrameworkComboBox.Items.Clear();
if (categoryTreeView.SelectedNode != null) {
foreach (TargetFramework fx in TargetFramework.TargetFrameworks) {
if (fx.DisplayName == null)
continue;
foreach (TemplateItem item in ((Category)categoryTreeView.SelectedNode).Templates) {
if (item.Template.HasSupportedTargetFrameworks && item.Template.SupportsTargetFramework(fx)) {
targetFrameworkComboBox.Items.Add(fx);
break;
}
}
}
}
if (targetFrameworkComboBox.Items.Count > 0) {
targetFrameworkComboBox.Visible = true;
targetFrameworkComboBox.SelectedIndex = 0;
string lastUsedTargetFramework = PropertyService.Get("Dialogs.NewProjectDialog.TargetFramework", TargetFramework.DefaultTargetFrameworkName);
for (int i = 0; i < targetFrameworkComboBox.Items.Count; i++) {
if (((TargetFramework)targetFrameworkComboBox.Items[i]).Name == lastUsedTargetFramework) {
targetFrameworkComboBox.SelectedIndex = i;
break;
}
}
} else {
targetFrameworkComboBox.Visible = false;
}
TargetFrameworkComboBoxSelectedIndexChanged(sender, e);
targetFrameworkComboBox.SelectedIndexChanged += TargetFrameworkComboBoxSelectedIndexChanged;
}
void TargetFrameworkComboBoxSelectedIndexChanged(object sender, EventArgs e)
{
templateListView.Items.Clear();
if (categoryTreeView.SelectedNode != null) {
TargetFramework currentFramework = targetFrameworkComboBox.SelectedItem as TargetFramework;
foreach (TemplateItem item in ((Category)categoryTreeView.SelectedNode).Templates) {
if (currentFramework == null || item.Template.SupportsTargetFramework(currentFramework)) {
templateListView.Items.Add(item);
}
}
}
this.SelectedIndexChange(sender, e);
@ -190,43 +218,27 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -190,43 +218,27 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
e.Node.ImageIndex = 0;
}
void CheckedChange(object sender, EventArgs e)
{
((TextBox)ControlDictionary["solutionNameTextBox"]).ReadOnly = !((CheckBox)ControlDictionary["createSeparateDirCheckBox"]).Checked;
if (((TextBox)ControlDictionary["solutionNameTextBox"]).ReadOnly) { // unchecked created own directory for solution
NameTextChanged(null, null); // set the value of the ((TextBox)ControlDictionary["solutionNameTextBox"]) to ((TextBox)ControlDictionary["nameTextBox"])
}
}
void NameTextChanged(object sender, EventArgs e)
{
if (!((CheckBox)ControlDictionary["createSeparateDirCheckBox"]).Checked) {
((TextBox)ControlDictionary["solutionNameTextBox"]).Text = ((TextBox)ControlDictionary["nameTextBox"]).Text.Trim();
}
}
string ProjectSolution {
string NewProjectDirectory {
get {
string name = String.Empty;
if (((CheckBox)ControlDictionary["createSeparateDirCheckBox"]).Checked) {
name += Path.DirectorySeparatorChar + ((TextBox)ControlDictionary["solutionNameTextBox"]).Text.Trim();
if (createDirectoryForSolutionCheckBox.Checked) {
return Path.Combine(NewSolutionDirectory, nameTextBox.Text.Trim());
} else {
return NewSolutionDirectory;
}
return ProjectLocation + name;
}
}
string ProjectLocation {
string NewSolutionDirectory {
get {
string location = ((TextBox)ControlDictionary["locationTextBox"]).Text.TrimEnd('\\', '/', Path.DirectorySeparatorChar);
string name = ((TextBox)ControlDictionary["nameTextBox"]).Text.Trim();
return location.Trim() + (((CheckBox)ControlDictionary["autoCreateSubDirCheckBox"]).Checked ? Path.DirectorySeparatorChar + name : String.Empty);
string location = locationTextBox.Text;
string name = createDirectoryForSolutionCheckBox.Checked ? solutionNameTextBox.Text : nameTextBox.Text;
return Path.Combine(location.Trim(), name.Trim());
}
}
void PathChanged(object sender, EventArgs e)
{
string solutionPath = ProjectSolution;
string solutionPath = NewProjectDirectory;
try {
if (solutionPath.Length > 3 && Path.IsPathRooted(solutionPath)) {
solutionPath = solutionPath.Substring(3);
@ -240,21 +252,21 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -240,21 +252,21 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
solutionPath = solutionPath.Substring(idx);
didCut = true;
}
solutionPath = ProjectSolution.Substring(0, 3) + (didCut ? "..." : "") + solutionPath;
solutionPath = NewProjectDirectory.Substring(0, 3) + (didCut ? "..." : "") + solutionPath;
if (solutionPath.Length > maxLength + 6) {
solutionPath = solutionPath.Substring(0, maxLength + 3) + "...";
}
}
} catch (ArgumentException) {
ControlDictionary["createInLabel"].Text = ResourceService.GetString("ICSharpCode.SharpDevelop.Gui.Dialogs.NewProjectDialog.IllegalProjectNameError").Replace("\n", " ").Replace("\r", "");
createInLabel.Text = ResourceService.GetString("ICSharpCode.SharpDevelop.Gui.Dialogs.NewProjectDialog.IllegalProjectNameError").Replace("\n", " ").Replace("\r", "");
return;
}
ControlDictionary["createInLabel"].Text = ResourceService.GetString("Dialog.NewProject.ProjectAtDescription")+ " " + solutionPath;
createInLabel.Text = ResourceService.GetString("Dialog.NewProject.ProjectAtDescription")+ " " + solutionPath;
}
void IconSizeChange(object sender, EventArgs e)
{
((ListView)ControlDictionary["templateListView"]).View = ((RadioButton)ControlDictionary["smallIconsRadioButton"]).Checked ? View.List : View.LargeIcon;
templateListView.View = smallIconsRadioButton.Checked ? View.List : View.LargeIcon;
}
public string NewProjectLocation;
@ -263,21 +275,17 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -263,21 +275,17 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
void OpenEvent(object sender, EventArgs e)
{
if (((TreeView)ControlDictionary["categoryTreeView"]).SelectedNode != null) {
PropertyService.Set("Dialogs.NewProjectDialog.LastSelectedCategory", ((TreeView)ControlDictionary["categoryTreeView"]).SelectedNode.Text);
PropertyService.Set("Dialogs.NewProjectDialog.LargeImages", ((RadioButton)ControlDictionary["largeIconsRadioButton"]).Checked);
if (categoryTreeView.SelectedNode != null) {
PropertyService.Set("Dialogs.NewProjectDialog.LastSelectedCategory", categoryTreeView.SelectedNode.Text);
PropertyService.Set("Dialogs.NewProjectDialog.LargeImages", largeIconsRadioButton.Checked);
}
string solution = ((TextBox)ControlDictionary["solutionNameTextBox"]).Text.Trim();
string name = ((TextBox)ControlDictionary["nameTextBox"]).Text.Trim();
string location = ((TextBox)ControlDictionary["locationTextBox"]).Text.Trim();
if (!FileUtility.IsValidPath(solution)
|| solution.IndexOf(Path.DirectorySeparatorChar) >= 0
|| solution.IndexOf(Path.AltDirectorySeparatorChar) >= 0
|| !FileUtility.IsValidPath(name)
|| name.IndexOf(Path.AltDirectorySeparatorChar) >= 0
|| name.IndexOf(Path.DirectorySeparatorChar) >= 0
string solution = solutionNameTextBox.Text.Trim();
string name = nameTextBox.Text.Trim();
string location = locationTextBox.Text.Trim();
if (!FileUtility.IsValidDirectoryName(solution)
|| !FileUtility.IsValidDirectoryName(name)
|| !FileUtility.IsValidPath(location))
{
MessageService.ShowError("${res:ICSharpCode.SharpDevelop.Gui.Dialogs.NewProjectDialog.IllegalProjectNameError}");
@ -292,11 +300,10 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -292,11 +300,10 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
return;
}
PropertyService.Set("ICSharpCode.SharpDevelop.Gui.NewProjectDialog.AutoCreateProjectSubdir", ((CheckBox)ControlDictionary["autoCreateSubDirCheckBox"]).Checked);
if (((ListView)ControlDictionary["templateListView"]).SelectedItems.Count == 1 && ((TextBox)ControlDictionary["locationTextBox"]).Text.Length > 0 && ((TextBox)ControlDictionary["solutionNameTextBox"]).Text.Length > 0) {
TemplateItem item = (TemplateItem)((ListView)ControlDictionary["templateListView"]).SelectedItems[0];
if (templateListView.SelectedItems.Count == 1 && locationTextBox.Text.Length > 0 && solutionNameTextBox.Text.Length > 0) {
TemplateItem item = (TemplateItem)templateListView.SelectedItems[0];
try {
System.IO.Directory.CreateDirectory(ProjectSolution);
System.IO.Directory.CreateDirectory(NewProjectDirectory);
} catch (Exception) {
MessageService.ShowError("${res:ICSharpCode.SharpDevelop.Gui.Dialogs.NewProjectDialog.CantCreateDirectoryError}");
@ -306,11 +313,20 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -306,11 +313,20 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
ProjectCreateInformation cinfo = new ProjectCreateInformation();
if (!createNewSolution) {
cinfo.Solution = ProjectService.OpenSolution;
cinfo.SolutionPath = Path.GetDirectoryName(cinfo.Solution.FileName);
cinfo.SolutionName = cinfo.Solution.Name;
} else {
cinfo.SolutionPath = NewSolutionDirectory;
}
if (item.Template.HasSupportedTargetFrameworks) {
cinfo.TargetFramework = ((TargetFramework)targetFrameworkComboBox.SelectedItem).Name;
PropertyService.Set("Dialogs.NewProjectDialog.TargetFramework", cinfo.TargetFramework);
}
cinfo.SolutionPath = ProjectLocation;
cinfo.ProjectBasePath = ProjectSolution;
cinfo.ProjectBasePath = NewProjectDirectory;
cinfo.SolutionName = solution;
cinfo.ProjectName = name;
NewSolutionLocation = item.Template.CreateProject(cinfo);
@ -318,18 +334,17 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -318,18 +334,17 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
return;
}
if (createNewSolution) {
ProjectService.LoadSolutionOrProject(NewSolutionLocation);
ProjectService.LoadSolution(NewSolutionLocation);
item.Template.RunOpenActions(cinfo);
}
NewProjectLocation = cinfo.CreatedProjects.Count > 0 ? cinfo.CreatedProjects[0] : "";
NewProjectLocation = cinfo.createdProjects.Count > 0 ? cinfo.createdProjects[0].FileName : "";
DialogResult = DialogResult.OK;
}
}
void BrowseDirectories(object sender, EventArgs e)
{
TextBox locationTextBox = ((TextBox)ControlDictionary["locationTextBox"]);
using (FolderBrowserDialog fd = FileService.CreateFolderBrowserDialog("${res:Dialog.NewProject.SelectDirectoryForProject}", locationTextBox.Text)) {
if (fd.ShowDialog() == DialogResult.OK) {
locationTextBox.Text = fd.SelectedPath;
@ -340,12 +355,12 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -340,12 +355,12 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
// list view event handlers
void SelectedIndexChange(object sender, EventArgs e)
{
if (((ListView)ControlDictionary["templateListView"]).SelectedItems.Count == 1) {
ControlDictionary["descriptionLabel"].Text = StringParser.Parse(((TemplateItem)((ListView)ControlDictionary["templateListView"]).SelectedItems[0]).Template.Description);
ControlDictionary["openButton"].Enabled = true;
if (templateListView.SelectedItems.Count == 1) {
descriptionLabel.Text = StringParser.Parse(((TemplateItem)templateListView.SelectedItems[0]).Template.Description);
openButton.Enabled = true;
} else {
ControlDictionary["descriptionLabel"].Text = String.Empty;
ControlDictionary["openButton"].Enabled = false;
descriptionLabel.Text = String.Empty;
openButton.Enabled = false;
}
}
@ -353,7 +368,7 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -353,7 +368,7 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
{
foreach (TreeNode node in nodes) {
if (node.Name == name) {
((TreeView)ControlDictionary["categoryTreeView"]).SelectedNode = node;
categoryTreeView.SelectedNode = node;
node.ExpandAll();
return node;
}
@ -365,53 +380,66 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -365,53 +380,66 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
return null;
}
protected void InitializeComponents()
static bool CreateDirectoryForSolution {
get { return PropertyService.Get("Dialogs.NewProjectDialog.CreateDirectoryForSolution", true); }
set { PropertyService.Set("Dialogs.NewProjectDialog.CreateDirectoryForSolution", value); }
}
protected void MyInitializeComponents()
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.NewProjectDialog.xfrm"));
InitializeComponent();
foreach (Control ctl in Controls.GetRecursive()) {
ctl.Text = StringParser.Parse(ctl.Text);
}
this.Text = StringParser.Parse(this.Text);
ImageList imglist = new ImageList();
imglist.ColorDepth = ColorDepth.Depth32Bit;
imglist.Images.Add(IconService.GetBitmap("Icons.16x16.OpenFolderBitmap"));
imglist.Images.Add(IconService.GetBitmap("Icons.16x16.ClosedFolderBitmap"));
((TreeView)ControlDictionary["categoryTreeView"]).ImageList = imglist;
categoryTreeView.ImageList = imglist;
((ListView)ControlDictionary["templateListView"]).DoubleClick += new EventHandler(OpenEvent);
((ListView)ControlDictionary["templateListView"]).SelectedIndexChanged += new EventHandler(SelectedIndexChange);
((TreeView)ControlDictionary["categoryTreeView"]).AfterSelect += new TreeViewEventHandler(CategoryChange);
((TreeView)ControlDictionary["categoryTreeView"]).BeforeSelect += new TreeViewCancelEventHandler(OnBeforeExpand);
((TreeView)ControlDictionary["categoryTreeView"]).BeforeExpand += new TreeViewCancelEventHandler(OnBeforeExpand);
((TreeView)ControlDictionary["categoryTreeView"]).BeforeCollapse += new TreeViewCancelEventHandler(OnBeforeCollapse);
((TextBox)ControlDictionary["solutionNameTextBox"]).TextChanged += new EventHandler(PathChanged);
((TextBox)ControlDictionary["nameTextBox"]).TextChanged += new EventHandler(NameTextChanged);
((TextBox)ControlDictionary["nameTextBox"]).TextChanged += new EventHandler(PathChanged);
((TextBox)ControlDictionary["locationTextBox"]).TextChanged += new EventHandler(PathChanged);
templateListView.SelectedIndexChanged += new EventHandler(SelectedIndexChange);
categoryTreeView.AfterSelect += new TreeViewEventHandler(CategoryChange);
categoryTreeView.BeforeSelect += new TreeViewCancelEventHandler(OnBeforeExpand);
categoryTreeView.BeforeExpand += new TreeViewCancelEventHandler(OnBeforeExpand);
categoryTreeView.BeforeCollapse += new TreeViewCancelEventHandler(OnBeforeCollapse);
solutionNameTextBox.TextChanged += new EventHandler(PathChanged);
nameTextBox.TextChanged += new EventHandler(PathChanged);
locationTextBox.TextChanged += new EventHandler(PathChanged);
if (createNewSolution) {
createDirectoryForSolutionCheckBox.Checked = CreateDirectoryForSolution;
createDirectoryForSolutionCheckBox.CheckedChanged += delegate {
CreateDirectoryForSolution = createDirectoryForSolutionCheckBox.Checked;
};
} else {
solutionNameTextBox.Visible = false;
solutionNameLabel.Visible = false;
createDirectoryForSolutionCheckBox.Visible = false;
bottomPanel.Height -= solutionNameTextBox.Height;
createDirectoryForSolutionCheckBox.Checked = false;
}
((RadioButton)ControlDictionary["largeIconsRadioButton"]).Checked = PropertyService.Get("Dialogs.NewProjectDialog.LargeImages", true);
((RadioButton)ControlDictionary["largeIconsRadioButton"]).CheckedChanged += new EventHandler(IconSizeChange);
((RadioButton)ControlDictionary["largeIconsRadioButton"]).FlatStyle = FlatStyle.Standard;
((RadioButton)ControlDictionary["largeIconsRadioButton"]).Image = IconService.GetBitmap("Icons.16x16.LargeIconsIcon");
largeIconsRadioButton.Checked = PropertyService.Get("Dialogs.NewProjectDialog.LargeImages", true);
largeIconsRadioButton.CheckedChanged += new EventHandler(IconSizeChange);
largeIconsRadioButton.Image = IconService.GetBitmap("Icons.16x16.LargeIconsIcon");
((RadioButton)ControlDictionary["smallIconsRadioButton"]).Checked = !PropertyService.Get("Dialogs.NewProjectDialog.LargeImages", true);
((RadioButton)ControlDictionary["smallIconsRadioButton"]).CheckedChanged += new EventHandler(IconSizeChange);
((RadioButton)ControlDictionary["smallIconsRadioButton"]).FlatStyle = FlatStyle.Standard;
((RadioButton)ControlDictionary["smallIconsRadioButton"]).Image = IconService.GetBitmap("Icons.16x16.SmallIconsIcon");
smallIconsRadioButton.Checked = !PropertyService.Get("Dialogs.NewProjectDialog.LargeImages", true);
smallIconsRadioButton.CheckedChanged += new EventHandler(IconSizeChange);
smallIconsRadioButton.Image = IconService.GetBitmap("Icons.16x16.SmallIconsIcon");
ControlDictionary["openButton"] .Click += new EventHandler(OpenEvent);
ControlDictionary["browseButton"].Click += new EventHandler(BrowseDirectories);
((CheckBox)ControlDictionary["createSeparateDirCheckBox"]).CheckedChanged += new EventHandler(CheckedChange);
((CheckBox)ControlDictionary["createSeparateDirCheckBox"]).CheckedChanged += new EventHandler(PathChanged);
((CheckBox)ControlDictionary["autoCreateSubDirCheckBox"]).CheckedChanged += new EventHandler(PathChanged);
openButton.Click += new EventHandler(OpenEvent);
browseButton.Click += new EventHandler(BrowseDirectories);
createDirectoryForSolutionCheckBox.CheckedChanged += new EventHandler(PathChanged);
ToolTip tooltip = new ToolTip();
tooltip.SetToolTip(ControlDictionary["largeIconsRadioButton"], StringParser.Parse("${res:Global.LargeIconToolTip}"));
tooltip.SetToolTip(ControlDictionary["smallIconsRadioButton"], StringParser.Parse("${res:Global.SmallIconToolTip}"));
tooltip.SetToolTip(largeIconsRadioButton, StringParser.Parse("${res:Global.LargeIconToolTip}"));
tooltip.SetToolTip(smallIconsRadioButton, StringParser.Parse("${res:Global.SmallIconToolTip}"));
tooltip.Active = true;
Owner = WorkbenchSingleton.MainForm;
StartPosition = FormStartPosition.CenterParent;
Icon = null;
CheckedChange(this, EventArgs.Empty);
IconSizeChange(this, EventArgs.Empty);
}
@ -474,5 +502,14 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -474,5 +502,14 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
}
}
}
string oldProjectName;
void NameTextBoxTextChanged(object sender, EventArgs e)
{
if (solutionNameTextBox.Text == oldProjectName || solutionNameTextBox.TextLength == 0) {
solutionNameTextBox.Text = oldProjectName = nameTextBox.Text;
}
}
}
}

120
src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.resx

@ -0,0 +1,120 @@ @@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

57
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs

@ -6,7 +6,9 @@ @@ -6,7 +6,9 @@
// </file>
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using ICSharpCode.Core;
@ -226,18 +228,15 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -226,18 +228,15 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
}
}
MethodInvoker reinitializeTargetFramework;
protected void InitTargetFramework(string defaultTargets, string extendedTargets)
protected void InitTargetFramework()
{
Button convertProjectToMSBuild35Button = (Button)ControlDictionary["convertProjectToMSBuild35Button"];
ComboBox targetFrameworkComboBox = (ComboBox)ControlDictionary["targetFrameworkComboBox"];
if (convertProjectToMSBuild35Button != null) {
if (project.MinimumSolutionVersion == 9) {
if (project.MinimumSolutionVersion == Solution.SolutionVersionVS05) {
// VS05 project
targetFrameworkComboBox.Enabled = false;
reinitializeTargetFramework = delegate { InitTargetFramework(defaultTargets, extendedTargets); };
convertProjectToMSBuild35Button.Click += OnConvertProjectToMSBuild35ButtonClick;
return;
} else {
@ -249,43 +248,17 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -249,43 +248,17 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
const string TargetFrameworkProperty = "TargetFrameworkVersion";
ConfigurationGuiBinding targetFrameworkBinding;
targetFrameworkBinding = helper.BindStringEnum("targetFrameworkComboBox", TargetFrameworkProperty,
"v2.0",
new StringPair("v2.0", ".NET Framework 2.0"),
new StringPair("v3.0", ".NET Framework 3.0"),
new StringPair("v3.5", ".NET Framework 3.5"),
new StringPair("CF 2.0", "Compact Framework 2.0"),
new StringPair("Mono v1.1", "Mono 1.1"),
new StringPair("Mono v2.0", "Mono 2.0"));
targetFrameworkBinding = helper.BindStringEnum(
"targetFrameworkComboBox", TargetFrameworkProperty,
"v2.0",
(from targetFramework in Internal.Templates.TargetFramework.TargetFrameworks
where targetFramework.DisplayName != null
select new StringPair(targetFramework.Name, targetFramework.DisplayName)).ToArray());
targetFrameworkBinding.CreateLocationButton("targetFrameworkLabel");
helper.Saved += delegate {
MSBuildBasedProject project = helper.Project;
// Test if SharpDevelop-Build extensions are needed
bool needExtensions = false;
foreach (MSBuild.BuildProperty p in project.GetAllProperties(TargetFrameworkProperty)) {
if (p.IsImported == false) {
if (p.Value.StartsWith("CF") || p.Value.StartsWith("Mono")) {
needExtensions = true;
}
}
}
foreach (MSBuild.Import import in project.MSBuildProject.Imports) {
if (needExtensions) {
if (defaultTargets.Equals(import.ProjectPath, StringComparison.InvariantCultureIgnoreCase)) {
//import.ProjectPath = extendedTargets;
MSBuildInternals.SetImportProjectPath(project, import, extendedTargets);
break;
}
} else {
if (extendedTargets.Equals(import.ProjectPath, StringComparison.InvariantCultureIgnoreCase)) {
//import.ProjectPath = defaultTargets;
MSBuildInternals.SetImportProjectPath(project, import, defaultTargets);
break;
}
}
}
CompilableProject cProject = (CompilableProject)project;
cProject.AddOrRemoveExtensions();
};
}
@ -302,8 +275,10 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -302,8 +275,10 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
} else {
project.ConvertToMSBuild35(dlg.ChangeTargetFramework);
}
if (project.MinimumSolutionVersion == Solution.SolutionVersionVS05)
throw new InvalidOperationException("Project did not convert to MSBuild 3.5");
ProjectService.SaveSolution();
reinitializeTargetFramework();
InitTargetFramework();
}
}
}

75
src/Main/Base/Project/Src/Internal/Templates/File/ScriptRunner.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
@ -38,49 +39,52 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -38,49 +39,52 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
return file.Content;
}
// TODO: AppDomain loading !!!5
byte[] GetBytes(string fileName)
static Dictionary<string, Assembly> cachedAssemblies = new Dictionary<string, Assembly>();
static Assembly CompileAssembly(string fileContent)
{
using (FileStream fs = new FileStream(fileName, FileMode.Open)) {
long size = fs.Length;
byte[] outArray = new byte[size];
fs.Read(outArray, 0, (int)size);
fs.Close();
return outArray;
if (cachedAssemblies.ContainsKey(fileContent))
return cachedAssemblies[fileContent];
using (TempFileCollection tf = new TempFileCollection()) {
string path = Path.Combine(tf.BasePath, tf.TempDir);
Directory.CreateDirectory(path);
string generatedScript = Path.Combine(path, "InternalGeneratedScript.cs");
string generatedDLL = Path.Combine(path, "A.DLL");
tf.AddFile(generatedScript, false);
tf.AddFile(generatedDLL, false);
StreamWriter sw = new StreamWriter(generatedScript);
sw.Write(fileContent);
sw.Close();
string output = String.Empty;
string error = String.Empty;
Executor.ExecWaitWithCapture(GetCompilerName() + " /target:library \"/out:" + generatedDLL + "\" \"" + generatedScript +"\"", tf, ref output, ref error);
if (!File.Exists(generatedDLL)) {
StreamReader sr = File.OpenText(output);
string errorMessage = sr.ReadToEnd();
sr.Close();
MessageService.ShowMessage(errorMessage);
return null;
}
Assembly asm = Assembly.Load(File.ReadAllBytes(generatedDLL));
cachedAssemblies[fileContent] = asm;
return asm;
}
}
string CompileAndGetOutput(string fileContent)
{
TempFileCollection tf = new TempFileCollection ();
string path = Path.Combine(tf.BasePath, tf.TempDir);
Directory.CreateDirectory(path);
string generatedScript = Path.Combine(path, "InternalGeneratedScript.cs");
string generatedDLL = Path.Combine(path, "A.DLL");
tf.AddFile(generatedScript, false);
tf.AddFile(generatedDLL, false);
StreamWriter sw = new StreamWriter(generatedScript);
sw.Write(fileContent);
sw.Close();
string output = String.Empty;
string error = String.Empty;
Executor.ExecWaitWithCapture(GetCompilerName() + " /target:library \"/out:" + generatedDLL + "\" \"" + generatedScript +"\"", tf, ref output, ref error);
if (!File.Exists(generatedDLL)) {
StreamReader sr = File.OpenText(output);
string errorMessage = sr.ReadToEnd();
sr.Close();
MessageService.ShowMessage(errorMessage);
Assembly asm = CompileAssembly(fileContent);
if (asm == null) {
return ">>>>ERROR IN CODE GENERATION GENERATED SCRIPT WAS:\n" + fileContent + "\n>>>>END";
}
Assembly asm = Assembly.Load(GetBytes(generatedDLL));
object templateInstance = asm.CreateInstance("Template");
@ -90,11 +94,10 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -90,11 +94,10 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
}
MethodInfo methodInfo = templateInstance.GetType().GetMethod("GenerateOutput");
string ret = methodInfo.Invoke(templateInstance, null).ToString();
tf.Delete();
return ret;
}
string GetCompilerName()
static string GetCompilerName()
{
string runtimeDirectory = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory();
return '"' + Path.Combine(runtimeDirectory, "csc.exe") + '"';

69
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectCreateInformation.cs

@ -6,9 +6,10 @@ @@ -6,9 +6,10 @@
// </file>
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop.Internal.Templates
@ -21,63 +22,19 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -21,63 +22,19 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
/// </summary>
public class ProjectCreateInformation
{
string projectName;
string solutionPath;
string projectBasePath;
string outputProjectFileName;
string rootNamespace;
Solution solution;
internal List<string> CreatedProjects = new List<string>();
public string OutputProjectFileName {
get {
return outputProjectFileName;
}
set {
outputProjectFileName = value;
}
}
public string ProjectName {
get {
return projectName;
}
set {
projectName = value;
}
}
public string RootNamespace {
get {
return rootNamespace;
}
set {
rootNamespace = value;
}
}
internal List<IProject> createdProjects = new List<IProject>();
public string SolutionPath {
get {
return solutionPath;
}
set {
solutionPath = value;
}
public ReadOnlyCollection<IProject> CreatedProjects {
get { return createdProjects.AsReadOnly(); }
}
public string ProjectBasePath {
get {
return projectBasePath;
}
set {
projectBasePath = value;
}
}
public Solution Solution {
get { return solution; }
set { solution = value; }
}
public string OutputProjectFileName { get; set; }
public string ProjectName { get; set; }
public string SolutionName { get; set; }
public string RootNamespace { get; set; }
public string SolutionPath { get; set; }
public string ProjectBasePath { get; set; }
public string TargetFramework { get; set; }
public Solution Solution { get; set; }
}
}

3
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs

@ -381,7 +381,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -381,7 +381,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
project.Save();
}
projectCreateInformation.CreatedProjects.Add(project.FileName);
projectCreateInformation.createdProjects.Add(project);
ProjectService.OnProjectCreated(new ProjectEventArgs(project));
return project;
}
finally

166
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs

@ -10,6 +10,7 @@ using System.Collections; @@ -10,6 +10,7 @@ using System.Collections;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.ComponentModel;
using System.IO;
using System.Windows.Forms;
@ -21,20 +22,66 @@ using ICSharpCode.SharpDevelop.Project; @@ -21,20 +22,66 @@ using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop.Internal.Templates
{
public class OpenFileAction
sealed class TargetFramework
{
string fileName;
public readonly static TargetFramework Net20 = new TargetFramework("v2.0", ".NET Framework 2.0");
public readonly static TargetFramework Net30 = new TargetFramework("v3.0", ".NET Framework 3.0") { BasedOn = Net20 };
public readonly static TargetFramework Net35 = new TargetFramework("v3.5", ".NET Framework 3.5") { BasedOn = Net30 };
public readonly static TargetFramework CF = new TargetFramework("CF", null);
public readonly static TargetFramework CF20 = new TargetFramework("CF 2.0", "Compact Framework 2.0") { BasedOn = CF };
public readonly static TargetFramework Mono = new TargetFramework("Mono", null);
public readonly static TargetFramework Mono10 = new TargetFramework("Mono v1.1", "Mono 1.1") { BasedOn = Mono };
public readonly static TargetFramework Mono20 = new TargetFramework("Mono v2.0", "Mono 2.0") { BasedOn = Mono10 };
public OpenFileAction(string fileName)
public readonly static TargetFramework[] TargetFrameworks = {
Net35, Net30, Net20,
CF, CF20,
Mono, Mono20, Mono10
};
public const string DefaultTargetFrameworkName = "v3.5";
public static TargetFramework GetByName(string name)
{
foreach (TargetFramework tf in TargetFrameworks) {
if (tf.Name == name)
return tf;
}
throw new ArgumentException("No target framework '" + name + "' exists");
}
string name, displayName;
public string Name {
get { return name; }
}
public string DisplayName {
get { return displayName; }
}
public TargetFramework BasedOn;
public bool IsBasedOn(TargetFramework potentialBase)
{
TargetFramework tmp = this;
while (tmp != null) {
if (tmp == potentialBase)
return true;
tmp = tmp.BasedOn;
}
return false;
}
public TargetFramework(string name, string displayName)
{
this.fileName = fileName;
this.name = name;
this.displayName = displayName;
}
public void Run(ProjectCreateInformation projectCreateInformation)
public override string ToString()
{
string parsedFileName = StringParser.Parse(fileName, new string[,] { {"ProjectName", projectCreateInformation.ProjectName} });
string path = FileUtility.Combine(projectCreateInformation.ProjectBasePath, parsedFileName);
FileService.OpenFile(path);
return DisplayName;
}
}
@ -50,6 +97,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -50,6 +97,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
/// </summary>
public static ReadOnlyCollection<ProjectTemplate> ProjectTemplates {
get {
WorkbenchSingleton.AssertMainThread();
#if DEBUG
// Always reload project templates if debugging.
// TODO: Make this a configurable option.
@ -63,16 +112,29 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -63,16 +112,29 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
}
}
string originator = null;
string created = null;
string lastmodified = null;
string name = null;
string category = null;
string languagename = null;
string description = null;
string icon = null;
string wizardpath = null;
string subcategory = null;
string originator;
string created;
string lastmodified;
string name;
string category;
string languagename;
string description;
string icon;
string wizardpath;
string subcategory;
TargetFramework[] supportedTargetFrameworks;
internal bool HasSupportedTargetFrameworks {
get { return supportedTargetFrameworks != null; }
}
internal bool SupportsTargetFramework(TargetFramework framework)
{
if (supportedTargetFrameworks == null)
return true;
// return true if framework is based on any of the supported target frameworks
return supportedTargetFrameworks.Any(framework.IsBasedOn);
}
int IComparable.CompareTo(object other)
{
@ -83,9 +145,9 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -83,9 +145,9 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
return name.CompareTo(pt.name);
}
bool newProjectDialogVisible = true;
bool newProjectDialogVisible = true;
ArrayList actions = new ArrayList();
List<Action<ProjectCreateInformation>> actions = new List<Action<ProjectCreateInformation>>();
SolutionDescriptor solutionDescriptor = null;
ProjectDescriptor projectDescriptor = null;
@ -219,6 +281,12 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -219,6 +281,12 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
icon = config["Icon"].InnerText;
}
if (config["SupportedTargetFrameworks"] != null) {
supportedTargetFrameworks =
config["SupportedTargetFrameworks"].InnerText.Split(';')
.Select<string,TargetFramework>(TargetFramework.GetByName).ToArray();
}
string hintPath = Path.GetDirectoryName(xmlFileName);
if (templateElement["Solution"] != null) {
solutionDescriptor = SolutionDescriptor.CreateSolutionDescriptor(templateElement["Solution"], hintPath);
@ -240,11 +308,45 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -240,11 +308,45 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
// Read Actions;
if (templateElement["Actions"] != null) {
foreach (XmlElement el in templateElement["Actions"]) {
actions.Add(new OpenFileAction(el.Attributes["filename"].InnerText));
ReadAction(el);
}
}
}
void ReadAction(XmlElement el)
{
switch (el.Name) {
case "Open":
if (el.HasAttribute("filename")) {
string fileName = el.GetAttribute("filename");
actions.Add(
projectCreateInformation => {
string parsedFileName = StringParser.Parse(fileName, new string[,] { {"ProjectName", projectCreateInformation.ProjectName} });
string path = FileUtility.Combine(projectCreateInformation.ProjectBasePath, parsedFileName);
FileService.OpenFile(path);
});
} else {
WarnAttributeMissing(el, "filename");
}
break;
case "RunCommand":
if (el.HasAttribute("path")) {
ICommand command = (ICommand)AddInTree.BuildItem(el.GetAttribute("path"), null);
actions.Add(
projectCreateInformation => {
command.Owner = projectCreateInformation;
command.Run();
});
} else {
WarnAttributeMissing(el, "path");
}
break;
default:
WarnObsoleteNode(el, "Unknown action element is interpreted as <Open>");
goto case "Open";
}
}
internal static void WarnObsoleteNode(XmlElement element, string message)
{
MessageService.ShowWarning("Obsolete node <" + element.Name +
@ -284,12 +386,22 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -284,12 +386,22 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
if (solutionDescriptor != null) {
return solutionDescriptor.CreateSolution(projectCreateInformation, this.languagename);
} else if (projectDescriptor != null) {
projectCreateInformation.Solution = new Solution();
bool createNewSolution = projectCreateInformation.Solution == null;
if (createNewSolution) {
projectCreateInformation.Solution = new Solution();
projectCreateInformation.Solution.Name = projectCreateInformation.SolutionName;
projectCreateInformation.Solution.FileName = Path.Combine(projectCreateInformation.SolutionPath, projectCreateInformation.SolutionName + ".sln");
}
IProject project = projectDescriptor.CreateProject(projectCreateInformation, this.languagename);
if (project != null)
return project.FileName;
else
if (project != null) {
if (createNewSolution) {
projectCreateInformation.Solution.AddFolder(project);
projectCreateInformation.Solution.Save();
}
return projectCreateInformation.Solution.FileName;
} else {
return null;
}
} else {
return null;
}
@ -297,8 +409,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -297,8 +409,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
public void RunOpenActions(ProjectCreateInformation projectCreateInformation)
{
foreach (OpenFileAction action in actions) {
action.Run(projectCreateInformation);
foreach (Action<ProjectCreateInformation> action in actions) {
action(projectCreateInformation);
}
}

6
src/Main/Base/Project/Src/Internal/Templates/Project/SolutionDescriptor.cs

@ -98,12 +98,12 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -98,12 +98,12 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
projectCreateInformation.Solution = newSolution;
string newSolutionName = StringParser.Parse(name, new string[,] {
{"ProjectName", projectCreateInformation.ProjectName}
{"ProjectName", projectCreateInformation.SolutionName}
});
newSolution.Name = newSolutionName;
string oldCombinePath = projectCreateInformation.SolutionPath;
string oldSolutionPath = projectCreateInformation.SolutionPath;
string oldProjectPath = projectCreateInformation.ProjectBasePath;
if (relativeDirectory != null && relativeDirectory.Length > 0 && relativeDirectory != ".") {
projectCreateInformation.SolutionPath = Path.Combine(projectCreateInformation.SolutionPath, relativeDirectory);
@ -116,7 +116,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -116,7 +116,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
}
}
projectCreateInformation.SolutionPath = oldCombinePath;
projectCreateInformation.SolutionPath = oldSolutionPath;
projectCreateInformation.ProjectBasePath = oldProjectPath;
if (!mainFolder.AddContents(newSolution, projectCreateInformation, defaultLanguage, newSolution)) {

2
src/Main/Base/Project/Src/Project/AbstractProject.cs

@ -443,7 +443,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -443,7 +443,7 @@ namespace ICSharpCode.SharpDevelop.Project
[Browsable(false)]
public virtual int MinimumSolutionVersion {
get { return 9; }
get { return Solution.SolutionVersionVS05; }
}
public virtual void ResolveAssemblyReferences()

79
src/Main/Base/Project/Src/Project/CompilableProject.cs

@ -5,14 +5,15 @@ @@ -5,14 +5,15 @@
// <version>$Revision$</version>
// </file>
using ICSharpCode.SharpDevelop.Internal.Templates;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Debugging;
using System.Diagnostics;
using System.Collections.Generic;
using MSBuild = Microsoft.Build.BuildEngine;
namespace ICSharpCode.SharpDevelop.Project
@ -78,6 +79,11 @@ namespace ICSharpCode.SharpDevelop.Project @@ -78,6 +79,11 @@ namespace ICSharpCode.SharpDevelop.Project
this.RootNamespace = information.RootNamespace;
this.AssemblyName = information.ProjectName;
if (!string.IsNullOrEmpty(information.TargetFramework)) {
this.TargetFrameworkVersion = information.TargetFramework;
AddOrRemoveExtensions();
}
SetProperty("Debug", null, "OutputPath", @"bin\Debug\",
PropertyStorageLocations.ConfigurationSpecific, true);
SetProperty("Release", null, "OutputPath", @"bin\Release\",
@ -141,6 +147,11 @@ namespace ICSharpCode.SharpDevelop.Project @@ -141,6 +147,11 @@ namespace ICSharpCode.SharpDevelop.Project
get;
}
public string TargetFrameworkVersion {
get { return GetEvaluatedProperty("TargetFrameworkVersion") ?? "v2.0"; }
set { SetProperty("TargetFrameworkVersion", value); }
}
public override string AssemblyName {
get { return GetEvaluatedProperty("AssemblyName") ?? Name; }
set { SetProperty("AssemblyName", value); }
@ -344,21 +355,21 @@ namespace ICSharpCode.SharpDevelop.Project @@ -344,21 +355,21 @@ namespace ICSharpCode.SharpDevelop.Project
}
}
protected void ConvertToMSBuild35(bool changeTargetFrameworkToNet35, string DefaultTargetsFile, string ExtendedTargetsFile)
public override void ConvertToMSBuild35(bool changeTargetFrameworkToNet35)
{
lock (SyncRoot) {
base.ConvertToMSBuild35(changeTargetFrameworkToNet35);
var winFxImport = MSBuildProject.Imports.Cast<Microsoft.Build.BuildEngine.Import>()
.Where(import => !import.IsImported)
.FirstOrDefault(import => string.Equals(import.ProjectPath, "$(MSBuildBinPath)\\Microsoft.WinFX.targets", StringComparison.OrdinalIgnoreCase));
if (winFxImport != null) {
MSBuildProject.Imports.RemoveImport(winFxImport);
}
bool needsExtensions = false;
if (changeTargetFrameworkToNet35) {
SetProperty(null, null, "TargetFrameworkVersion", "v3.5", PropertyStorageLocations.Base, true);
ReferenceProjectItem rpi = new ReferenceProjectItem(this, "System.Core");
rpi.SetMetadata("RequiredTargetFramework", "3.5");
ProjectService.AddProjectItem(this, rpi);
AddDotnet35References();
} else {
foreach (string config in ConfigurationNames) {
foreach (string platform in PlatformNames) {
@ -377,18 +388,52 @@ namespace ICSharpCode.SharpDevelop.Project @@ -377,18 +388,52 @@ namespace ICSharpCode.SharpDevelop.Project
}
if (targetFrameworkVersion == "v2.0" && winFxImport != null)
targetFrameworkVersion = "v3.0";
if (targetFrameworkVersion.StartsWith("CF") || targetFrameworkVersion.StartsWith("Mono"))
needsExtensions = true;
SetProperty(config, platform, "TargetFrameworkVersion", targetFrameworkVersion, loc, true);
}
}
}
if (!needsExtensions) {
foreach (Microsoft.Build.BuildEngine.Import import in MSBuildProject.Imports) {
if (ExtendedTargetsFile.Equals(import.ProjectPath, StringComparison.InvariantCultureIgnoreCase)) {
MSBuildInternals.SetImportProjectPath(this, import, DefaultTargetsFile);
break;
}
}
AddOrRemoveExtensions();
}
protected internal virtual void AddDotnet35References()
{
ReferenceProjectItem rpi = new ReferenceProjectItem(this, "System.Core");
rpi.SetMetadata("RequiredTargetFramework", "3.5");
ProjectService.AddProjectItem(this, rpi);
if (GetItemsOfType(ItemType.Reference).Cast<ReferenceProjectItem>()
.Any(r => r.Include == "System.Data"))
{
rpi = new ReferenceProjectItem(this, "System.Data.DataSetExtensions");
rpi.SetMetadata("RequiredTargetFramework", "3.5");
ProjectService.AddProjectItem(this, rpi);
}
if (GetItemsOfType(ItemType.Reference).Cast<ReferenceProjectItem>()
.Any(r => r.Include == "System.Xml"))
{
rpi = new ReferenceProjectItem(this, "System.Xml.Linq");
rpi.SetMetadata("RequiredTargetFramework", "3.5");
ProjectService.AddProjectItem(this, rpi);
}
}
protected internal virtual void AddOrRemoveExtensions()
{
}
}
namespace Commands
{
public class AddDotNet35ReferencesIfTargetFrameworkIs35Command : AbstractCommand
{
public override void Run()
{
ProjectCreateInformation pci = (ProjectCreateInformation)Owner;
foreach (IProject p in pci.CreatedProjects) {
CompilableProject cp = p as CompilableProject;
if (cp != null && cp.TargetFrameworkVersion == "v3.5") {
cp.AddDotnet35References();
}
}
}

4
src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs

@ -68,9 +68,9 @@ namespace ICSharpCode.SharpDevelop.Project @@ -68,9 +68,9 @@ namespace ICSharpCode.SharpDevelop.Project
if (string.IsNullOrEmpty(project.DefaultToolsVersion)
|| project.DefaultToolsVersion == "2.0")
{
return 9;
return Solution.SolutionVersionVS05;
} else {
return 10;
return Solution.SolutionVersionVS08;
}
}
}

3
src/Main/Base/Project/Src/Project/Solution/Solution.cs

@ -28,6 +28,9 @@ namespace ICSharpCode.SharpDevelop.Project @@ -28,6 +28,9 @@ namespace ICSharpCode.SharpDevelop.Project
public class Solution : SolutionFolder, IDisposable, IMSBuildEngineProvider, IBuildable
{
public const int SolutionVersionVS05 = 9;
public const int SolutionVersionVS08 = 10;
/// <summary>contains <guid>, (IProject/ISolutionFolder) pairs.</summary>
Dictionary<string, ISolutionFolder> guidDictionary = new Dictionary<string, ISolutionFolder>();

13
src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

@ -595,7 +595,20 @@ namespace ICSharpCode.SharpDevelop.Project @@ -595,7 +595,20 @@ namespace ICSharpCode.SharpDevelop.Project
ProjectAdded(null, e);
}
}
internal static void OnProjectCreated(ProjectEventArgs e)
{
if (ProjectCreated != null) {
ProjectCreated(null, e);
}
}
/// <summary>
/// Is raised when a new project is created.
/// </summary>
public static event ProjectEventHandler ProjectCreated;
/// <summary>
/// Is raised when a new or existing project is added to the solution.
/// </summary>
public static event ProjectEventHandler ProjectAdded;
public static event SolutionFolderEventHandler SolutionFolderRemoved;

11
src/Main/Base/Project/Src/TextEditor/Commands/CodeGenerators/ConstructorCodeGenerator.cs

@ -5,10 +5,10 @@ @@ -5,10 +5,10 @@
// <version>$Revision$</version>
// </file>
using ICSharpCode.SharpDevelop.Dom;
using System;
using System.Collections;
using System.Collections.Generic;
using ICSharpCode.NRefactory.Ast;
namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
@ -48,5 +48,14 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands @@ -48,5 +48,14 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
}
nodes.Add(ctor);
}
protected override void InitContent()
{
foreach (IField field in currentClass.Fields) {
if (!field.IsStatic) {
Content.Add(new FieldWrapper(field));
}
}
}
}
}

4
src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs

@ -404,6 +404,10 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -404,6 +404,10 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
BookmarkManager bm = textEditorControl.Document.BookmarkManager;
bm.RemoveMarks(new Predicate<Bookmark>(IsClassMemberBookmark));
if (parseInfo == null) return;
Debug.Assert(textEditorControl.Document.TotalNumberOfLines >= 1);
if (textEditorControl.Document.TotalNumberOfLines < 1) {
return;
}
foreach (IClass c in parseInfo.MostRecentCompilationUnit.Classes) {
AddClassMemberBookmarks(bm, c);
}

13
src/Main/Base/Project/Src/Util/ExtensionMethods.cs

@ -7,9 +7,10 @@ @@ -7,9 +7,10 @@
using System;
using System.Collections;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows.Forms;
namespace ICSharpCode.SharpDevelop
{
@ -39,5 +40,15 @@ namespace ICSharpCode.SharpDevelop @@ -39,5 +40,15 @@ namespace ICSharpCode.SharpDevelop
{
return string.Join(separator, input.ToArray());
}
public static IEnumerable<Control> GetRecursive(this Control.ControlCollection collection)
{
foreach (Control ctl in collection) {
yield return ctl;
foreach (Control subCtl in ctl.Controls.GetRecursive()) {
yield return subCtl;
}
}
}
}
}

24
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/CompoundClass.cs

@ -14,6 +14,14 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -14,6 +14,14 @@ namespace ICSharpCode.SharpDevelop.Dom
{
/// <summary>
/// A class made up of multiple partial classes.
///
/// The class is thread-safe, accessing the Methods/Properties etc. collections
/// returns a copy of that collection. However, each access may return a different
/// collection when the parser thread updates a parts belonging to this class.
/// Therefore, code like "compoundClass.Methods[compoundClass.Methods.Count - 1]" is
/// not thread-safe! If you need to access one of the collections multiple times,
/// call the property getter only once and store the result in a local variable.
/// "var methods = compoundClass.Methods; return methods[methods.Count - 1];" is thread-safe.
/// </summary>
public class CompoundClass : DefaultClass
{
@ -21,7 +29,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -21,7 +29,7 @@ namespace ICSharpCode.SharpDevelop.Dom
/// The parts this class is based on.
/// Requires manual locking!
/// </summary>
internal List<IClass> parts = new List<IClass>();
internal readonly List<IClass> parts = new List<IClass>();
/// <summary>
/// Gets the parts this class is based on. This method is thread-safe and
@ -29,7 +37,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -29,7 +37,7 @@ namespace ICSharpCode.SharpDevelop.Dom
/// </summary>
public IList<IClass> GetParts()
{
lock (this) {
lock (parts) {
return parts.ToArray();
}
}
@ -95,7 +103,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -95,7 +103,7 @@ namespace ICSharpCode.SharpDevelop.Dom
/// </summary>
public override IList<ITypeParameter> TypeParameters {
get {
lock (this) {
lock (parts) {
// Locking for the time of getting the reference to the sub-list is sufficient:
// Classes used for parts never change, instead the whole part is replaced with
// a new IClass instance.
@ -117,7 +125,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -117,7 +125,7 @@ namespace ICSharpCode.SharpDevelop.Dom
public override List<IClass> InnerClasses {
get {
lock (this) {
lock (parts) {
List<IClass> l = new List<IClass>();
foreach (IClass part in parts) {
l.AddRange(part.InnerClasses);
@ -129,7 +137,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -129,7 +137,7 @@ namespace ICSharpCode.SharpDevelop.Dom
public override List<IField> Fields {
get {
lock (this) {
lock (parts) {
List<IField> l = new List<IField>();
foreach (IClass part in parts) {
l.AddRange(part.Fields);
@ -141,7 +149,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -141,7 +149,7 @@ namespace ICSharpCode.SharpDevelop.Dom
public override List<IProperty> Properties {
get {
lock (this) {
lock (parts) {
List<IProperty> l = new List<IProperty>();
foreach (IClass part in parts) {
l.AddRange(part.Properties);
@ -153,7 +161,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -153,7 +161,7 @@ namespace ICSharpCode.SharpDevelop.Dom
public override List<IMethod> Methods {
get {
lock (this) {
lock (parts) {
List<IMethod> l = new List<IMethod>();
foreach (IClass part in parts) {
l.AddRange(part.Methods);
@ -165,7 +173,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -165,7 +173,7 @@ namespace ICSharpCode.SharpDevelop.Dom
public override List<IEvent> Events {
get {
lock (this) {
lock (parts) {
List<IEvent> l = new List<IEvent>();
foreach (IClass part in parts) {
l.AddRange(part.Events);

2
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ProjectContent/DefaultProjectContent.cs

@ -333,7 +333,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -333,7 +333,7 @@ namespace ICSharpCode.SharpDevelop.Dom
addClass.IsPartial = true;
// possibly replace existing class (look for CU with same filename)
lock (compound) {
lock (compound.parts) {
for (int i = 0; i < compound.parts.Count; i++) {
if (IsEqualFileName(compound.parts[i].CompilationUnit.FileName, addClass.CompilationUnit.FileName)) {
compound.parts[i] = addClass;

Loading…
Cancel
Save