Browse Source

support for DependentUpon and SubType attributes in XPT project templates added (see the Avalon* templates for a working demo)

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@638 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Mathias Simmack 20 years ago
parent
commit
8bd159545c
  1. 4
      data/templates/project/CSharp/AvalonApplication.xpt
  2. 4
      data/templates/project/CSharp/AvalonNavigationApplication.xpt
  3. 22
      src/Main/Base/Project/Src/Internal/Templates/File/FileDescriptionTemplate.cs
  4. 6
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs

4
data/templates/project/CSharp/AvalonApplication.xpt

@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
</Application.Resources>
</Application>]]></File>
<File name="MyApp.xaml.cs"><![CDATA[using System;
<File name="MyApp.xaml.cs" subType="Code" dependentUpon="MyApp.xaml"><![CDATA[using System;
using System.Windows;
using System.Data;
using System.Xml;
@ -82,7 +82,7 @@ namespace ${StandardNamespace} @@ -82,7 +82,7 @@ namespace ${StandardNamespace}
</Grid>
</Window>]]></File>
<File name="Window1.xaml.cs"><![CDATA[using System;
<File name="Window1.xaml.cs" subType="Code" dependentUpon="Window1.xaml"><![CDATA[using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;

4
data/templates/project/CSharp/AvalonNavigationApplication.xpt

@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
</Application.Resources>
</Application>]]></File>
<File name="MyApp.xaml.cs"><![CDATA[using System;
<File name="MyApp.xaml.cs" subType="Code" dependentUpon="MyApp.xaml"><![CDATA[using System;
using System.Windows;
using System.Windows.Navigation;
using System.Data;
@ -75,7 +75,7 @@ namespace ${StandardNamespace} @@ -75,7 +75,7 @@ namespace ${StandardNamespace}
</StackPanel>
</Page>]]></File>
<File name="Page1.xaml.cs"><![CDATA[using System;
<File name="Page1.xaml.cs" subType="Code" dependentUpon="Page1.xaml"><![CDATA[using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;

22
src/Main/Base/Project/Src/Internal/Templates/File/FileDescriptionTemplate.cs

@ -20,6 +20,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -20,6 +20,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
string content;
string buildAction;
string copyToOutputDirectory;
string dependentUpon;
string subType;
public FileDescriptionTemplate(XmlElement xml)
{
@ -27,6 +29,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -27,6 +29,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
language = xml.GetAttribute("language");
buildAction = xml.GetAttribute("buildAction");
copyToOutputDirectory = xml.GetAttribute("copyToOutputDirectory");
dependentUpon = xml.GetAttribute("dependentUpon");
subType = xml.GetAttribute("subType");
content = xml.InnerText;
}
@ -72,5 +76,23 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -72,5 +76,23 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
copyToOutputDirectory = value;
}
}
public string DependentUpon {
get {
return dependentUpon ?? "";
}
set {
dependentUpon = value;
}
}
public string SubType {
get {
return subType ?? "";
}
set {
subType = value;
}
}
}
}

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

@ -152,6 +152,12 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -152,6 +152,12 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
if (file.CopyToOutputDirectory.Length > 0) {
projectFile.CopyToOutputDirectory = (CopyToOutputDirectory)Enum.Parse(typeof(CopyToOutputDirectory), file.CopyToOutputDirectory);
}
if (file.DependentUpon.Length > 0) {
projectFile.DependentUpon = file.DependentUpon;
}
if (file.SubType.Length > 0) {
projectFile.SubType = file.SubType;
}
projectFile.Include = FileUtility.GetRelativePath(project.Directory, fileName);

Loading…
Cancel
Save