Browse Source

Added IronPython WPF project and file templates.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@6380 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Matt Ward 15 years ago
parent
commit
0171600afb
  1. 2
      src/AddIns/BackendBindings/Python/PythonBinding.sln
  2. 6
      src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj
  3. 95
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Templates/WPFApplication.xpt
  4. 27
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Templates/WPFWindow.xft
  5. 6
      src/Setup/Files.wxs
  6. 4
      src/Setup/Setup.wxs

2
src/AddIns/BackendBindings/Python/PythonBinding.sln

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
# SharpDevelop 4.0.0.5967
# SharpDevelop 4.0.0.6374
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PythonBinding", "PythonBinding\Project\PythonBinding.csproj", "{8D732610-8FC6-43BA-94C9-7126FD7FE361}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PythonBinding.Tests", "PythonBinding\Test\PythonBinding.Tests.csproj", "{23B517C9-1ECC-4419-A13F-0B7136D085CB}"

6
src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj

@ -208,6 +208,12 @@ @@ -208,6 +208,12 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<EmbeddedResource Include="Resources\Python.xshd" />
<None Include="Templates\WPFApplication.xpt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Templates\WPFWindow.xft">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="TestRunner\sdtest.py">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>

95
src/AddIns/BackendBindings/Python/PythonBinding/Project/Templates/WPFApplication.xpt

@ -0,0 +1,95 @@ @@ -0,0 +1,95 @@
<?xml version="1.0"?>
<Template originator="Matt Ward">
<TemplateConfiguration>
<Name>${res:Templates.Project.WinFXApplication.Name}</Name>
<Category>Python</Category>
<Icon>Python.Template.WinFormsProject</Icon>
<Description>${res:Templates.Project.WinFXApplication.Description}</Description>
<SupportedTargetFrameworks>v3.0</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->
<Actions>
<Open filename="Window1.xaml"/>
</Actions>
<!-- Template Content -->
<Project language="Python">
<CreateActions>
<RunCommand path="/SharpDevelop/BackendBindings/TemplateCommands/AddDotNet35ReferencesIfTargetFrameworkIs35"/>
</CreateActions>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<MainFile>Application.py</MainFile>
<DebugInfo>True</DebugInfo>
<StartArguments>-X:Debug Application.py</StartArguments>
<StartWorkingDirectory>.\</StartWorkingDirectory>
<StartAction>Program</StartAction>
<StartProgram>${addinpath:ICSharpCode.PythonBinding}\ipy.exe</StartProgram>
</PropertyGroup>
<PropertyGroup configuration="Release" escapeValue="false">
<OutputType>WinExe</OutputType>
<MainFile>Application.py</MainFile>
<StartArguments>Application.py</StartArguments>
<StartWorkingDirectory>.\</StartWorkingDirectory>
<StartAction>Program</StartAction>
<StartProgram>${addinpath:ICSharpCode.PythonBinding}\ipy.exe</StartProgram>
</PropertyGroup>
<ProjectItems>
<Reference Include="mscorlib"/>
<Reference Include="System"/>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="PresentationFramework">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="IronPython">
<HintPath>${addinpath:ICSharpCode.PythonBinding}\IronPython.dll</HintPath>
</Reference>
<Reference Include="IronPython.Modules">
<HintPath>${addinpath:ICSharpCode.PythonBinding}\IronPython.Modules.dll</HintPath>
</Reference>
</ProjectItems>
<Files>
<File
name="Application.py"
SubType="Code">
<![CDATA[import clr
clr.AddReference('PresentationFramework')
from System.IO import FileMode, FileStream
from System.Windows import Application
from System.Windows.Markup import XamlReader
stream = FileStream('Window1.xaml', FileMode.Open)
window = XamlReader.Load(stream)
app = Application()
app.Run(window)
]]></File>
<File
name="Window1.xaml"
buildAction="None"
CopyToOutputDirectory="Always"
language="XML"><![CDATA[<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="${StandardNamespace}"
Height="300"
Width="300">
<Grid>
</Grid>
</Window>]]></File>
</Files>
</Project>
</Template>

27
src/AddIns/BackendBindings/Python/PythonBinding/Project/Templates/WPFWindow.xft

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
<Template author="Matt Ward" version="1.0">
<Config
name = "${res:Templates.File.WinFXWindow.Name}"
icon = "Python.Template.Form"
category = "Python"
defaultname = "Window${Number}.xaml"
language = "Python"/>
<Description>${res:Templates.File.WinFXWindow.Description}</Description>
<Files>
<File
name="${FullName}"
language="XML"
CopyToOutputDirectory="Always"
buildAction="None">
<![CDATA[<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="${ClassName}" Height="300" Width="300">
<Grid>
</Grid>
</Window>]]></File>
</Files>
<AdditionalOptions/>
</Template>

6
src/Setup/Files.wxs

@ -1041,6 +1041,12 @@ @@ -1041,6 +1041,12 @@
<Component Guid="6AE9C385-3B6A-4DD6-9CB9-92EDEEEF3FCF" Id="PythonLibraryProjectTemplate" DiskId="1">
<File Source="..\..\AddIns\BackendBindings\PythonBinding\Templates\LibraryProject.xpt" Id="Templates.LibraryProject.xpt" Name="LibraryProject.xpt" KeyPath="yes" />
</Component>
<Component Id="PythonWPFApplicationProjectTemplate" Guid="5453F13D-AF45-464D-859E-A4DD8A66557C" DiskId="1">
<File Id="Python.WPFApplication.xpt" Name="WPFApplication.xpt" Source="..\..\AddIns\BackendBindings\PythonBinding\Templates\WPFApplication.xpt" KeyPath="yes" />
</Component>
<Component Id="PythonWPFWindowFileTemplate" Guid="BCCF7EE5-9A2F-42D2-B1B5-D885D6B51BDF" DiskId="1">
<File Id="Python.WPFWindow.xft" Name="WPFWindow.xft" Source="..\..\AddIns\BackendBindings\PythonBinding\Templates\WPFWindow.xft" KeyPath="yes" />
</Component>
</Directory>
<Component Guid="DE04B306-0C6D-434C-A6DC-6F450AAFB108" Id="IronPythonModulesDll" DiskId="1">
<File Source="..\..\AddIns\BackendBindings\PythonBinding\IronPython.Modules.dll" Name="IronPython.Modules.dll" Id="IronPython.Modules.dll" KeyPath="yes" Assembly=".net" AssemblyApplication="IronPython.Modules.dll" AssemblyManifest="IronPython.Modules.dll">

4
src/Setup/Setup.wxs

@ -399,7 +399,9 @@ @@ -399,7 +399,9 @@
<ComponentRef Id="PythonEmptyUserControlTemplate"/>
<ComponentRef Id="PythonEmptyFileTemplate"/>
<ComponentRef Id="PythonFormsProjectTemplate"/>
<ComponentRef Id="PythonLibraryProjectTemplate"/>
<ComponentRef Id="PythonLibraryProjectTemplate"/>
<ComponentRef Id="PythonWPFApplicationProjectTemplate"/>
<ComponentRef Id="PythonWPFWindowFileTemplate"/>
<ComponentRef Id="IpyExe"/>
<ComponentRef Id="IronPythonModulesDll"/>
<ComponentRef Id="IronPythonModulesXml"/>

Loading…
Cancel
Save