Browse Source

Update WPF template for IronPython 2.7

pull/15/head
mrward 15 years ago
parent
commit
3e10978ef4
  1. 10
      src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj
  2. 25
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Templates/WPFApplication.xpt
  3. BIN
      src/AddIns/BackendBindings/Python/RequiredLibraries/DLLs/IronPython.Wpf.dll
  4. 53
      src/AddIns/BackendBindings/Python/RequiredLibraries/DLLs/IronPython.Wpf.xml
  5. 5
      src/Setup/Files.wxs
  6. 3
      src/Setup/Setup.wxs

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

@ -48,18 +48,23 @@ @@ -48,18 +48,23 @@
</Reference>
<Reference Include="IronPython">
<HintPath>..\..\RequiredLibraries\IronPython.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="IronPython.Modules">
<HintPath>..\..\RequiredLibraries\IronPython.Modules.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Dynamic">
<HintPath>..\..\RequiredLibraries\Microsoft.Dynamic.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Scripting">
<HintPath>..\..\RequiredLibraries\Microsoft.Scripting.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Scripting.Metadata">
<HintPath>..\..\RequiredLibraries\Microsoft.Scripting.Metadata.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
@ -186,6 +191,10 @@ @@ -186,6 +191,10 @@
<Link>Chiron.exe.Config</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\RequiredLibraries\DLLs\IronPython.Wpf.dll">
<Link>DLLs\IronPython.Wpf.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\RequiredLibraries\License.Rtf">
<Link>License.Rtf</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
@ -245,6 +254,7 @@ @@ -245,6 +254,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Lib" />
<Folder Include="DLLs" />
<Folder Include="TestRunner" />
<Folder Include="Templates" />
<Folder Include="Resources" />

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

@ -54,21 +54,20 @@ @@ -54,21 +54,20 @@
<Reference Include="IronPython.Modules">
<HintPath>${addinpath:ICSharpCode.PythonBinding}\IronPython.Modules.dll</HintPath>
</Reference>
<Reference Include="IronPython.Wpf">
<HintPath>${addinpath:ICSharpCode.PythonBinding}\DLLs\IronPython.Wpf.dll</HintPath>
</Reference>
</ProjectItems>
<Files>
<File
name="Application.py"
SubType="Code">
<![CDATA[import clr
clr.AddReference('PresentationFramework')
<![CDATA[import wpf
from System.IO import FileMode, FileStream
from System.Windows import Application
from System.Windows.Markup import XamlReader
from Window1 import Window1
stream = FileStream('Window1.xaml', FileMode.Open)
window = XamlReader.Load(stream)
window = Window1()
app = Application()
app.Run(window)
]]></File>
@ -86,6 +85,18 @@ app.Run(window) @@ -86,6 +85,18 @@ app.Run(window)
</Grid>
</Window>]]></File>
<File
name="Window1.py"
SubType="Code">
<![CDATA[import wpf
from System.Windows import Window
class Window1 (Window):
def __init__(self):
wpf.LoadComponent(self, 'Window1.xaml')
]]></File>
</Files>
</Project>
</Template>

BIN
src/AddIns/BackendBindings/Python/RequiredLibraries/DLLs/IronPython.Wpf.dll

Binary file not shown.

53
src/AddIns/BackendBindings/Python/RequiredLibraries/DLLs/IronPython.Wpf.xml

@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>IronPython.Wpf</name>
</assembly>
<members>
<member name="T:IronPython.Modules.Wpf">
<summary>
Provides helpers for interacting with Windows Presentation Foundation applications.
</summary>
</member>
<member name="M:IronPython.Modules.Wpf.LoadComponent(IronPython.Runtime.CodeContext,System.Object,System.String)">
<summary>
Loads XAML from the specified XmlReader and returns the deserialized object. Any event handlers
are bound to methods defined in the provided module. Any named objects are assigned to the object.
The provided object is expected to be the same type as the root of the XAML element.
</summary>
</member>
<member name="M:IronPython.Modules.Wpf.LoadComponent(IronPython.Runtime.CodeContext,System.Object,System.IO.Stream)">
<summary>
Loads XAML from the specified XmlReader and returns the deserialized object. Any event handlers
are bound to methods defined in the provided module. Any named objects are assigned to the object.
The provided object is expected to be the same type as the root of the XAML element.
</summary>
</member>
<member name="M:IronPython.Modules.Wpf.LoadComponent(IronPython.Runtime.CodeContext,System.Object,System.Xml.XmlReader)">
<summary>
Loads XAML from the specified XmlReader and returns the deserialized object. Any event handlers
are bound to methods defined in the provided module. Any named objects are assigned to the object.
The provided object is expected to be the same type as the root of the XAML element.
</summary>
</member>
<member name="M:IronPython.Modules.Wpf.LoadComponent(IronPython.Runtime.CodeContext,System.Object,System.IO.TextReader)">
<summary>
Loads XAML from the specified XmlReader and returns the deserialized object. Any event handlers
are bound to methods defined in the provided module. Any named objects are assigned to the object.
The provided object is expected to be the same type as the root of the XAML element.
</summary>
</member>
<member name="M:IronPython.Modules.Wpf.LoadComponent(IronPython.Runtime.CodeContext,System.Object,System.Xaml.XamlXmlReader)">
<summary>
Loads XAML from the specified XmlReader and returns the deserialized object. Any event handlers
are bound to methods defined in the provided module. Any named objects are assigned to the object.
The provided object is expected to be the same type as the root of the XAML element.
</summary>
</member>
</members>
</doc>

5
src/Setup/Files.wxs

@ -1112,6 +1112,11 @@ @@ -1112,6 +1112,11 @@
<Component Id="MicrosoftScriptingMetadataDll" Guid="7FD24C6E-5E64-4CCB-8C1E-2315498F81B1" DiskId="1">
<File Id="Microsoft.Scripting.Metadata.dll" Name="Microsoft.Scripting.Metadata.dll" Source="..\..\AddIns\BackendBindings\PythonBinding\Microsoft.Scripting.Metadata.dll" KeyPath="yes" Assembly=".net" AssemblyApplication="Microsoft.Scripting.Metadata.dll" AssemblyManifest="Microsoft.Scripting.Metadata.dll" />
</Component>
<Directory Id="PythonBindingDLLsFolder" Name="DLLs">
<Component Id="IronPythonWpfDll" Guid="D7A0FA37-CA4A-4678-8650-A8BF37A5FED0" DiskId="1">
<File Id="IronPython.Wpf.dll" Name="IronPython.Wpf.dll" Source="..\..\AddIns\BackendBindings\PythonBinding\DLLs\IronPython.Wpf.dll" KeyPath="yes" Assembly=".net" AssemblyApplication="IronPython.Wpf.dll" AssemblyManifest="IronPython.Wpf.dll" />
</Component>
</Directory>
</Directory>
<Directory Id="FSharpBinding" Name="FSharpBinding">
<Component Guid="6B4F28AF-133C-4FEB-98DB-67A5405AEB12" Id="FSharpBindingAddin" DiskId="1">

3
src/Setup/Setup.wxs

@ -408,8 +408,9 @@ @@ -408,8 +408,9 @@
<ComponentRef Id="IpyExe"/>
<ComponentRef Id="IronPythonModulesDll"/>
<ComponentRef Id="IronPythonModulesXml"/>
<ComponentRef Id="IronPythonDll"/>
<ComponentRef Id="IronPythonDll"/>
<ComponentRef Id="IronPythonXml"/>
<ComponentRef Id="IronPythonWpfDll"/>
<ComponentRef Id="IronPythonLicenseRtf"/>
<ComponentRef Id="PythonChironExe"/>
<ComponentRef Id="PythonChironExeConfig"/>

Loading…
Cancel
Save