Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Finished recursion feature, migrated silverlight 5 binding feature

  • Loading branch information...
commit 72e25375dcca76ea83b395809df69637d0bb2537 1 parent c7a026e
jayt authored
Showing with 1,011 additions and 54 deletions.
  1. +1 −1  ImpromptuInterface.FSharp/AssemblyInfo.fs
  2. +9 −0 ImpromptuInterface.MVVM.Silverlight/ImpromptuInterface.MVVM (Silverlight).csproj
  3. BIN  ImpromptuInterface.MVVM.Silverlight/sn.snk
  4. +166 −0 ImpromptuInterface.MVVM.Silverlight5/ImpromptuInterface.MVVM (Silverlight5).csproj
  5. BIN  ImpromptuInterface.MVVM.Silverlight5/sn.snk
  6. +2 −2 ImpromptuInterface.MVVM/Properties/AssemblyInfo.cs
  7. +3 −0  ImpromptuInterface.Silverlight/ImpromptuInterface (Silverlight).csproj
  8. +236 −0 ImpromptuInterface.Silverlight5/ImpromptuInterface (Silverlight5).csproj
  9. BIN  ImpromptuInterface.Silverlight5/sn.snk
  10. +377 −0 ImpromptuInterface.Silverlight5/src/Dynamic/ImpromptuRuntimeType.cs
  11. +28 −0 ImpromptuInterface.sln
  12. +1 −0  ImpromptuInterface/ImpromptuInterface.csproj
  13. +2 −2 ImpromptuInterface/Properties/AssemblyInfo.cs
  14. +10 −1 ImpromptuInterface/src/Dynamic/ImpromptuObject.cs
  15. +17 −0 ImpromptuInterface/src/Dynamic/NonRecursiveInterfaceAttribute.cs
  16. +38 −20 ImpromptuInterface/src/EmitProxy/BuildProxy.cs
  17. +1 −1  NuGetBuild/Core/ImpromptuInterface.MetaData.xml
  18. +6 −2 NuGetBuild/Core/ImpromptuInterface.Symbol.nuspec
  19. +5 −1 NuGetBuild/Core/ImpromptuInterface.Symbol.tt
  20. +3 −1 NuGetBuild/Core/ImpromptuInterface.nuspec
  21. +2 −0  NuGetBuild/Core/ImpromptuInterface.tt
  22. +2 −2 NuGetBuild/FSharp/ImpromptuInterface.FSharp.MetaData.xml
  23. +8 −4 NuGetBuild/FSharp/ImpromptuInterface.FSharp.Symbol.nuspec
  24. +6 −2 NuGetBuild/FSharp/ImpromptuInterface.FSharp.Symbol.tt
  25. +4 −2 NuGetBuild/FSharp/ImpromptuInterface.FSharp.nuspec
  26. +2 −0  NuGetBuild/FSharp/ImpromptuInterface.FSharp.tt
  27. +2 −2 NuGetBuild/MVVM/ImpromptuInterface.MVVM.MetaData.xml
  28. +7 −3 NuGetBuild/MVVM/ImpromptuInterface.MVVM.Symbol.nuspec
  29. +5 −1 NuGetBuild/MVVM/ImpromptuInterface.MVVM.Symbol.tt
  30. +4 −3 NuGetBuild/MVVM/ImpromptuInterface.MVVM.nuspec
  31. +2 −1  NuGetBuild/MVVM/ImpromptuInterface.MVVM.tt
  32. +1 −1  Tests/UnitTestImpromptuInterface.SelfRunner/Support/Helper.cs
  33. +42 −0 Tests/UnitTestImpromptuInterface/Basic.cs
  34. +19 −2 Tests/UnitTestImpromptuInterface/Support/SupportDefinitions.cs
View
2  ImpromptuInterface.FSharp/AssemblyInfo.fs
@@ -40,5 +40,5 @@ open System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the ‘*’ as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[<assembly: AssemblyVersion("1.1.4.0")>]
+[<assembly: AssemblyVersion("1.2.0.0")>]
()
View
9 ImpromptuInterface.MVVM.Silverlight/ImpromptuInterface.MVVM (Silverlight).csproj
@@ -48,6 +48,12 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>Bin\Release\ImpromptuInterface.MVVM.XML</DocumentationFile>
</PropertyGroup>
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -141,6 +147,9 @@
<Name>ImpromptuInterface %28Silverlight%29</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <None Include="sn.snk" />
+ </ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
View
BIN  ImpromptuInterface.MVVM.Silverlight/sn.snk
Binary file not shown
View
166 ImpromptuInterface.MVVM.Silverlight5/ImpromptuInterface.MVVM (Silverlight5).csproj
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{4D6515F6-A10B-4EA8-A9E3-7C621DEB0D73}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>ImpromptuInterface.MVVM</RootNamespace>
+ <AssemblyName>ImpromptuInterface.MVVM</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>false</SilverlightApplication>
+ <ValidateXaml>true</ValidateXaml>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>Bin\Release</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT SILVERLIGHT5</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <DocumentationFile>Bin\Release\ImpromptuInterface.MVVM.XML</DocumentationFile>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.CSharp, Version=5.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.ComponentModel.Composition, Version=5.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\ImpromptuInterface.MVVM.Silverlight\src\Support.cs">
+ <Link>src\Support.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\Properties\AssemblyInfo.cs">
+ <Link>Properties\AssemblyInfo.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\DialogBox.cs">
+ <Link>DialogBox.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\Event.cs">
+ <Link>Event.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\FireOnChange.cs">
+ <Link>FireOnChange.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\IContainer.cs">
+ <Link>IContainer.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\ImpromptuBindingList.cs">
+ <Link>ImpromptuBindingList.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\ImpromptuCommandBinder.cs">
+ <Link>ImpromptuCommandBinder.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\ImpromptuRelayCommand.cs">
+ <Link>ImpromptuRelayCommand.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\ImpromptuToString.cs">
+ <Link>ImpromptuToString.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\ImpromptuViewModel-Nested.cs">
+ <Link>ImpromptuViewModel-Nested.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\ImpromptuViewModel.cs">
+ <Link>ImpromptuViewModel.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\ImpromptuWindowBuilder.cs">
+ <Link>ImpromptuWindowBuilder.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\IoC.cs">
+ <Link>IoC.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\ISetupViewModel.cs">
+ <Link>ISetupViewModel.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\MEF\Container.cs">
+ <Link>src\MEF\Container.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\MEF\ViewAttribute.cs">
+ <Link>src\MEF\ViewAttribute.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\MEF\ViewModelAttribute.cs">
+ <Link>src\MEF\ViewModelAttribute.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\Ninject\Container.cs">
+ <Link>src\Ninject\Container.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\Ninject\Extensions.cs">
+ <Link>src\Ninject\Extensions.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\Runtime.cs">
+ <Link>Runtime.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\TinyIoC\Container.cs">
+ <Link>src\TinyIoc\Container.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.MVVM\src\Unity\Container.cs">
+ <Link>src\Unity\Container.cs</Link>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="..\NuGetBuild\MVVM\ImpromptuInterface.MVVM.MetaData.xml">
+ <Link>ImpromptuInterface.MVVM.MetaData.xml</Link>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ImpromptuInterface.Silverlight5\ImpromptuInterface %28Silverlight5%29.csproj">
+ <Project>{EC1B3513-CB1E-4796-899F-125FC05B2F41}</Project>
+ <Name>ImpromptuInterface %28Silverlight5%29</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="sn.snk" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
View
BIN  ImpromptuInterface.MVVM.Silverlight5/sn.snk
Binary file not shown
View
4 ImpromptuInterface.MVVM/Properties/AssemblyInfo.cs
@@ -42,7 +42,7 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
#if SILVERLIGHT
-[assembly: AssemblyVersion("3.8.0.0")]
+[assembly: AssemblyVersion("4.0.0.0")]
#else
-[assembly: AssemblyVersion("3.8.0.*")]
+[assembly: AssemblyVersion("4.0.0.*")]
#endif
View
3  ImpromptuInterface.Silverlight/ImpromptuInterface (Silverlight).csproj
@@ -154,6 +154,9 @@
<Compile Include="..\ImpromptuInterface\src\Dynamic\Mimic.cs">
<Link>src\Dynamic\Mimic.cs</Link>
</Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\NonRecursiveInterfaceAttribute.cs">
+ <Link>src\Dynamic\NonRecursiveInterfaceAttribute.cs</Link>
+ </Compile>
<Compile Include="..\ImpromptuInterface\src\Dynamic\ThisFunctions.cs">
<Link>src\Dynamic\ThisFunctions.cs</Link>
</Compile>
View
236 ImpromptuInterface.Silverlight5/ImpromptuInterface (Silverlight5).csproj
@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{EC1B3513-CB1E-4796-899F-125FC05B2F41}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>ImpromptuInterface</RootNamespace>
+ <AssemblyName>ImpromptuInterface</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>false</SilverlightApplication>
+ <ValidateXaml>true</ValidateXaml>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>Bin\Release</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT SILVERLIGHT5</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <DocumentationFile>Bin\Release\ImpromptuInterface.XML</DocumentationFile>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.CSharp, Version=5.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\ImpromptuInterface.Silverlight\src\Optimization\SilverlightConverter.cs">
+ <Link>src\Optimization\SilverlightConverter.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface.Silverlight\src\Support.cs">
+ <Link>src\Support.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\Properties\AssemblyInfo.cs">
+ <Link>Properties\AssemblyInfo.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\ActLikeCaster.cs">
+ <Link>src\ActLikeCaster.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\Builder.cs">
+ <Link>src\Dynamic\Builder.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\CacheableInvocation.cs">
+ <Link>src\Dynamic\CacheableInvocation.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\IActLike.cs">
+ <Link>src\Dynamic\IActLike.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\IDynamicKnowLike.cs">
+ <Link>src\Dynamic\IDynamicKnowLike.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\ImpromptuBuilder.cs">
+ <Link>src\Dynamic\ImpromptuBuilder.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\ImpromptuDictionary.cs">
+ <Link>src\Dynamic\ImpromptuDictionary.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\ImpromptuDictionaryBase.cs">
+ <Link>src\Dynamic\ImpromptuDictionaryBase.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\ImpromptuDummy.cs">
+ <Link>src\Dynamic\ImpromptuDummy.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\ImpromptuFactory.cs">
+ <Link>src\Dynamic\ImpromptuFactory.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\ImpromptuForwarder.cs">
+ <Link>src\Dynamic\ImpromptuForwarder.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\ImpromptuForwarderAddRemove.cs">
+ <Link>src\Dynamic\ImpromptuForwarderAddRemove.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\ImpromptuGet.cs">
+ <Link>src\Dynamic\ImpromptuGet.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\ImpromptuLateLibraryType.cs">
+ <Link>src\Dynamic\ImpromptuLateLibraryType.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\ImpromptuLazy.cs">
+ <Link>src\Dynamic\ImpromptuLazy.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\ImpromptuList.cs">
+ <Link>src\Dynamic\ImpromptuList.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\ImpromptuObject.cs">
+ <Link>src\Dynamic\ImpromptuObject.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\ImpromptuRecorder.cs">
+ <Link>src\Dynamic\ImpromptuRecorder.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\InlineLambdas.cs">
+ <Link>src\Dynamic\InlineLambdas.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\Invocation.cs">
+ <Link>src\Dynamic\Invocation.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\Mimic.cs">
+ <Link>src\Dynamic\Mimic.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\NonRecursiveInterfaceAttribute.cs">
+ <Link>src\Dynamic\NonRecursiveInterfaceAttribute.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\ThisFunctions.cs">
+ <Link>src\Dynamic\ThisFunctions.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Dynamic\UseNamedArgumentAttribute.cs">
+ <Link>src\Dynamic\UseNamedArgumentAttribute.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\EmitProxy\ActLikeProxy.cs">
+ <Link>src\EmitProxy\ActLikeProxy.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\EmitProxy\ActLikeProxyAttribute.cs">
+ <Link>src\EmitProxy\ActLikeProxyAttribute.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\EmitProxy\ActLikeProxySerializationHelper.cs">
+ <Link>src\EmitProxy\ActLikeProxySerializationHelper.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\EmitProxy\BuildProxy.cs">
+ <Link>src\EmitProxy\BuildProxy.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\EmitProxy\EmitExtensions.cs">
+ <Link>src\EmitProxy\EmitExtensions.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\EmitProxy\TypeHash.cs">
+ <Link>src\EmitProxy\TypeHash.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\IActLikeProxy.cs">
+ <Link>src\IActLikeProxy.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Impromptu.cs">
+ <Link>src\Impromptu.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Internal\Curry.cs">
+ <Link>src\Internal\Curry.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Internal\InvokeSetters.cs">
+ <Link>src\Internal\InvokeSetters.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\InvokeArg.cs">
+ <Link>src\InvokeArg.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\InvokeContext.cs">
+ <Link>src\InvokeContext.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\InvokeExt\InvokeExt.cs">
+ <Link>src\InvokeExt\InvokeExt.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\InvokeMemberName.cs">
+ <Link>src\InvokeMemberName.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Optimization\BareBonesList.cs">
+ <Link>src\Optimization\BareBonesList.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Optimization\BinderHash.cs">
+ <Link>src\Optimization\BinderHash.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Optimization\InvokeHelper-Regular.cs">
+ <Link>src\Optimization\InvokeHelper-Regular.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Optimization\InvokeHelper.cs">
+ <Link>src\Optimization\InvokeHelper.cs</Link>
+ </Compile>
+ <Compile Include="..\ImpromptuInterface\src\Optimization\Util.cs">
+ <Link>src\Optimization\Util.cs</Link>
+ </Compile>
+ <Compile Include="src\Dynamic\ImpromptuRuntimeType.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\ImpromptuInterface\src\Optimization\Util.cs.orig">
+ <Link>src\Optimization\Util.cs.orig</Link>
+ </None>
+ <None Include="sn.snk" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
+ </ItemGroup>
+ <ItemGroup />
+ <ItemGroup>
+ <Content Include="..\NuGetBuild\Core\ImpromptuInterface.MetaData.xml">
+ <Link>Properties\ImpromptuInterface.MetaData.xml</Link>
+ </Content>
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
View
BIN  ImpromptuInterface.Silverlight5/sn.snk
Binary file not shown
View
377 ImpromptuInterface.Silverlight5/src/Dynamic/ImpromptuRuntimeType.cs
@@ -0,0 +1,377 @@
+//
+// Copyright 2011 Ekon Benefits
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+using System;
+using System.Collections.Generic;
+using System.Dynamic;
+using System.Globalization;
+using System.Linq;
+using System.Reflection;
+
+namespace ImpromptuInterface.Dynamic
+{
+
+ /// <summary>
+ /// Runtime Property Info
+ /// </summary>
+ public class ImpromptuRuntimePropertyInfo:PropertyInfo
+ {
+ private readonly Type _declaringType;
+ private readonly string _propertyName;
+
+ private readonly CacheableInvocation _cachedGet;
+ private readonly CacheableInvocation _cachedSet;
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ImpromptuRuntimePropertyInfo"/> class.
+ /// </summary>
+ /// <param name="declaringType">Type of the declaring.</param>
+ /// <param name="propertyName">Name of the property.</param>
+ public ImpromptuRuntimePropertyInfo(Type declaringType, string propertyName)
+ {
+ _declaringType = declaringType;
+ _propertyName = propertyName;
+ _cachedGet = new CacheableInvocation(InvocationKind.Get, propertyName);
+ _cachedSet = new CacheableInvocation(InvocationKind.Set, propertyName);
+
+ }
+
+
+ public override object[] GetCustomAttributes(bool inherit)
+ {
+ return new object[]{};
+ }
+
+ public override bool IsDefined(Type attributeType, bool inherit)
+ {
+ return false;
+ }
+
+ public override object GetValue(object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
+ {
+ if (index !=null && index.Length > 0)
+ {
+ return Impromptu.InvokeGetIndex(obj, index);
+ }
+
+ return _cachedGet.Invoke(obj);
+ }
+
+ public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
+ {
+ if (index != null && index.Length > 0)
+ {
+ Impromptu.InvokeGetIndex(obj, index.Concat(new[] {value}).ToArray() );
+ return;
+ }
+ _cachedSet.Invoke(obj, value);
+ }
+
+ public override MethodInfo[] GetAccessors(bool nonPublic)
+ {
+ return new MethodInfo[]{};
+ }
+
+ public override MethodInfo GetGetMethod(bool nonPublic)
+ {
+ return null;
+ }
+
+ public override MethodInfo GetSetMethod(bool nonPublic)
+ {
+ return null;
+ }
+
+ public override ParameterInfo[] GetIndexParameters()
+ {
+ return new ParameterInfo[]{};
+ }
+
+ public override string Name
+ {
+ get { return _propertyName; }
+ }
+
+ public override Type DeclaringType
+ {
+ get { return _declaringType; }
+ }
+
+ public override Type ReflectedType
+ {
+ get { return _declaringType; }
+ }
+
+ public override Type PropertyType
+ {
+ get { return typeof (object); }
+ }
+
+ public override PropertyAttributes Attributes
+ {
+ get { return PropertyAttributes.None; }
+ }
+
+ public override bool CanRead
+ {
+ get { return true; }
+ }
+
+ public override bool CanWrite
+ {
+ get { return true; }
+ }
+
+ public override object[] GetCustomAttributes(Type attributeType, bool inherit)
+ {
+ return new object[]{};
+ }
+ }
+
+
+ /// <summary>
+ /// MetaData for dynamic types
+ /// </summary>
+ public class ImpromptuRuntimeType:Type
+ {
+ private readonly Type _baseType;
+ private readonly object _dynamicObject;
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ImpromptuRuntimeType"/> class.
+ /// </summary>
+ /// <param name="baseType">Type of the base.</param>
+ /// <param name="dynamicObject">The dynamic object.</param>
+ public ImpromptuRuntimeType(Type baseType, object dynamicObject)
+ {
+ _baseType = baseType;
+ _dynamicObject = dynamicObject;
+ }
+
+
+ public override object[] GetCustomAttributes(bool inherit)
+ {
+ return _baseType.GetCustomAttributes(inherit);
+ }
+
+ public override bool IsDefined(Type attributeType, bool inherit)
+ {
+ return IsDefined(attributeType, inherit);
+ }
+
+ public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
+ {
+ return _baseType.GetConstructors(bindingAttr);
+ }
+
+ public override Type GetInterface(string name, bool ignoreCase)
+ {
+ return _baseType.GetInterface(name, ignoreCase);
+ }
+
+ public override Type[] GetInterfaces()
+ {
+ return _baseType.GetInterfaces();
+ }
+
+ public override EventInfo GetEvent(string name, BindingFlags bindingAttr)
+ {
+ return _baseType.GetEvent(name, bindingAttr);
+ }
+
+ public override EventInfo[] GetEvents(BindingFlags bindingAttr)
+ {
+ return _baseType.GetEvents(bindingAttr);
+ }
+
+ public override Type[] GetNestedTypes(BindingFlags bindingAttr)
+ {
+ return _baseType.GetNestedTypes(bindingAttr);
+ }
+
+ public override Type GetNestedType(string name, BindingFlags bindingAttr)
+ {
+ return _baseType.GetNestedType(name, bindingAttr);
+ }
+
+ public override MemberInfo[] GetDefaultMembers()
+ {
+
+ return _baseType.GetDefaultMembers();
+ }
+
+ protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
+ {
+ return new ImpromptuRuntimePropertyInfo(this, name);
+ }
+
+ public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
+ {
+ if (_dynamicObject is DynamicObject)
+ {
+ return ((DynamicObject)_dynamicObject).GetDynamicMemberNames().Select(it => new ImpromptuRuntimePropertyInfo(this, it)).ToArray();
+ }
+ return _baseType.GetProperties(bindingAttr);
+ }
+
+ protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
+ {
+ return null;
+ }
+
+ public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
+ {
+ return _baseType.GetMethods(bindingAttr);
+ }
+
+ public override FieldInfo GetField(string name, BindingFlags bindingAttr)
+ {
+ return _baseType.GetField(name, bindingAttr);
+ }
+
+ public override FieldInfo[] GetFields(BindingFlags bindingAttr)
+ {
+ return _baseType.GetFields(bindingAttr);
+ }
+
+ public override MemberInfo[] GetMembers(BindingFlags bindingAttr)
+ {
+ return new MemberInfo[]{};
+ }
+
+ protected override TypeAttributes GetAttributeFlagsImpl()
+ {
+ return TypeAttributes.Public;
+ }
+
+ protected override bool IsArrayImpl()
+ {
+ return false;
+ }
+
+ protected override bool IsByRefImpl()
+ {
+ return false;
+ }
+
+ protected override bool IsPointerImpl()
+ {
+ return false;
+ }
+
+ protected override bool IsPrimitiveImpl()
+ {
+ return false;
+ }
+
+ protected override bool IsCOMObjectImpl()
+ {
+ return false;
+ }
+
+ public override Type GetElementType()
+ {
+ return null;
+ }
+
+ protected override bool HasElementTypeImpl()
+ {
+ return false;
+ }
+
+ public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters)
+ {
+ object tContext = typeof (object);
+ InvocationKind tKind;
+ if ((BindingFlags.GetProperty & invokeAttr) != 0)
+ {
+ tKind = name.Equals(Invocation.IndexBinderName) ? InvocationKind.GetIndex : InvocationKind.Get;
+ }
+ else if ((BindingFlags.SetProperty & invokeAttr) != 0)
+ {
+ tKind = name.Equals(Invocation.IndexBinderName) ? InvocationKind.SetIndex : InvocationKind.Set;
+
+ }
+ else
+ {
+ tKind = InvocationKind.InvokeMemberUnknown;
+ }
+
+ if((BindingFlags.NonPublic & invokeAttr) !=0)
+ {
+ tContext = target;
+ }
+ //Use cachedable invocation not because it's getting cached, but because the constructor matches the parameters better.
+ var tCachedInvocation = new CacheableInvocation(tKind, name, args.Length, namedParameters, tContext);
+ return tCachedInvocation.Invoke(target, args);
+ }
+
+ public override Type UnderlyingSystemType
+ {
+ get { return UnderlyingSystemType; }
+ }
+
+ protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
+ {
+
+ return null;
+ }
+
+ public override string Name
+ {
+ get { return _baseType.Name; }
+ }
+
+ public override Guid GUID
+ {
+ get { return _baseType.GUID; }
+ }
+
+ public override Module Module
+ {
+ get { return _baseType.Module; }
+ }
+
+ public override Assembly Assembly
+ {
+ get { return _baseType.Assembly; }
+ }
+
+ public override string FullName
+ {
+ get { return _baseType.FullName; }
+ }
+
+ public override string Namespace
+ {
+ get { return _baseType.Namespace; }
+ }
+
+ public override string AssemblyQualifiedName
+ {
+ get { return _baseType.AssemblyQualifiedName; }
+ }
+
+ public override Type BaseType
+ {
+ get { return _baseType.BaseType; }
+ }
+
+ public override object[] GetCustomAttributes(Type attributeType, bool inherit)
+ {
+ return _baseType.GetCustomAttributes(attributeType, inherit);
+ }
+ }
+}
View
28 ImpromptuInterface.sln
@@ -21,10 +21,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImpromptuInterface.MVVM (Si
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetBuild", "NuGetBuild\NuGetBuild.csproj", "{114BB5F5-AA44-4932-99E1-328A11F6C497}"
ProjectSection(ProjectDependencies) = postProject
+ {EC1B3513-CB1E-4796-899F-125FC05B2F41} = {EC1B3513-CB1E-4796-899F-125FC05B2F41}
{9181A92F-9A17-45A3-BBDB-EAC085A901A0} = {9181A92F-9A17-45A3-BBDB-EAC085A901A0}
{DAB7C056-660A-4153-8FF2-B80A41310AD7} = {DAB7C056-660A-4153-8FF2-B80A41310AD7}
{D6AFD960-23A5-4EB0-9EEE-33AEC422B1CB} = {D6AFD960-23A5-4EB0-9EEE-33AEC422B1CB}
{56215C8D-85AE-4FCB-BD33-89E6ABBA407B} = {56215C8D-85AE-4FCB-BD33-89E6ABBA407B}
+ {D4D82191-1F83-43FB-8309-83637D8D11E8} = {D4D82191-1F83-43FB-8309-83637D8D11E8}
+ {C6F699C3-C2C7-4393-B8C2-B5C234ED23D7} = {C6F699C3-C2C7-4393-B8C2-B5C234ED23D7}
+ {4D6515F6-A10B-4EA8-A9E3-7C621DEB0D73} = {4D6515F6-A10B-4EA8-A9E3-7C621DEB0D73}
EndProjectSection
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ImpromptuInterface.FSharp", "ImpromptuInterface.FSharp\ImpromptuInterface.FSharp.fsproj", "{D4D82191-1F83-43FB-8309-83637D8D11E8}"
@@ -55,6 +59,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{0D3016
.nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImpromptuInterface (Silverlight5)", "ImpromptuInterface.Silverlight5\ImpromptuInterface (Silverlight5).csproj", "{EC1B3513-CB1E-4796-899F-125FC05B2F41}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImpromptuInterface.MVVM (Silverlight5)", "ImpromptuInterface.MVVM.Silverlight5\ImpromptuInterface.MVVM (Silverlight5).csproj", "{4D6515F6-A10B-4EA8-A9E3-7C621DEB0D73}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -225,6 +233,26 @@ Global
{15A061C0-A102-460E-A70A-0AFFE49B364E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{15A061C0-A102-460E-A70A-0AFFE49B364E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{15A061C0-A102-460E-A70A-0AFFE49B364E}.Release|x86.ActiveCfg = Release|Any CPU
+ {EC1B3513-CB1E-4796-899F-125FC05B2F41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EC1B3513-CB1E-4796-899F-125FC05B2F41}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EC1B3513-CB1E-4796-899F-125FC05B2F41}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {EC1B3513-CB1E-4796-899F-125FC05B2F41}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {EC1B3513-CB1E-4796-899F-125FC05B2F41}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {EC1B3513-CB1E-4796-899F-125FC05B2F41}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EC1B3513-CB1E-4796-899F-125FC05B2F41}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EC1B3513-CB1E-4796-899F-125FC05B2F41}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {EC1B3513-CB1E-4796-899F-125FC05B2F41}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {EC1B3513-CB1E-4796-899F-125FC05B2F41}.Release|x86.ActiveCfg = Release|Any CPU
+ {4D6515F6-A10B-4EA8-A9E3-7C621DEB0D73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4D6515F6-A10B-4EA8-A9E3-7C621DEB0D73}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4D6515F6-A10B-4EA8-A9E3-7C621DEB0D73}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {4D6515F6-A10B-4EA8-A9E3-7C621DEB0D73}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {4D6515F6-A10B-4EA8-A9E3-7C621DEB0D73}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {4D6515F6-A10B-4EA8-A9E3-7C621DEB0D73}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4D6515F6-A10B-4EA8-A9E3-7C621DEB0D73}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4D6515F6-A10B-4EA8-A9E3-7C621DEB0D73}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {4D6515F6-A10B-4EA8-A9E3-7C621DEB0D73}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {4D6515F6-A10B-4EA8-A9E3-7C621DEB0D73}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
1  ImpromptuInterface/ImpromptuInterface.csproj
@@ -134,6 +134,7 @@
<DependentUpon>InlineLambdas.tt</DependentUpon>
</Compile>
<Compile Include="src\Dynamic\Invocation.cs" />
+ <Compile Include="src\Dynamic\NonRecursiveInterfaceAttribute.cs" />
<Compile Include="src\Dynamic\ThisFunctions.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
View
4 ImpromptuInterface/Properties/AssemblyInfo.cs
@@ -59,10 +59,10 @@
#if SILVERLIGHT
-[assembly: AssemblyVersion("5.9.0.0")]
+[assembly: AssemblyVersion("6.0.0.0")]
#else
-[assembly: AssemblyVersion("5.9.0.*")]
+[assembly: AssemblyVersion("6.0.0.*")]
#endif
View
11 ImpromptuInterface/src/Dynamic/ImpromptuObject.cs
@@ -204,7 +204,16 @@ public virtual bool TryTypeForName(string name, out Type returnType)
return Impromptu.ActLike<TInterface>(this, otherInterfaces);
}
+#if SILVERLIGHT5
-
+ /// <summary>
+ /// Gets the custom Type.
+ /// </summary>
+ /// <returns></returns>
+ public Type GetCustomType()
+ {
+ return new ImpromptuRuntimeType(GetType(), this);
+ }
+#endif
}
}
View
17 ImpromptuInterface/src/Dynamic/NonRecursiveInterfaceAttribute.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace ImpromptuInterface.Dynamic
+{
+ /// <summary>
+ /// Attribute on Inteface to stop proxy from recursively
+ /// proxying other interfaces
+ /// </summary>
+ [AttributeUsage(System.AttributeTargets.Method |
+ System.AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Property)]
+ public sealed class NonRecursiveInterfaceAttribute : Attribute
+ {
+ }
+}
View
58 ImpromptuInterface/src/EmitProxy/BuildProxy.cs
@@ -16,6 +16,7 @@
using System.Collections;
using System.Collections.ObjectModel;
using System.Linq.Expressions;
+using ImpromptuInterface.Dynamic;
using ImpromptuInterface.Optimization;
namespace ImpromptuInterface.Build
@@ -352,13 +353,21 @@ private static Type BuildTypeHelper(ModuleBuilder builder,Type contextType,param
}
#endif
+
+ var tNonRecursive = tInterface.GetCustomAttributes(typeof(NonRecursiveInterfaceAttribute), true).Any();
+
foreach (var tInfo in tInterface.GetProperties(BindingFlags.Public | BindingFlags.Instance))
{
- MakeProperty(builder, tInfo, tB, contextType, defaultImp: tPropertyNameHash.Add(tInfo.Name));
+ var tNonRecursiveProp = tNonRecursive ||
+ tInfo.GetCustomAttributes(typeof (NonRecursiveInterfaceAttribute), true).Any();
+
+ MakeProperty(builder, tInfo, tB, contextType, nonRecursive: tNonRecursiveProp, defaultImp: tPropertyNameHash.Add(tInfo.Name));
}
foreach (var tInfo in tInterface.GetMethods(BindingFlags.Public | BindingFlags.Instance).Where(it => !it.IsSpecialName))
{
- MakeMethod(builder, tInfo, tB, contextType, defaultImp: tMethodHashSet.Add(new MethodSigHash(tInfo)));
+ var tNonRecursiveMeth = tNonRecursive ||
+ tInfo.GetCustomAttributes(typeof(NonRecursiveInterfaceAttribute), true).Any();
+ MakeMethod(builder, tInfo, tB, contextType, nonRecursive: tNonRecursiveMeth, defaultImp: tMethodHashSet.Add(new MethodSigHash(tInfo)));
}
foreach (var tInfo in tInterface.GetEvents(BindingFlags.Public | BindingFlags.Instance).Where(it => !it.IsSpecialName))
{
@@ -489,10 +498,10 @@ private static CustomAttributeBuilder GetAttributeBuilder(CustomAttributeData da
}
#endif
- private static void MakeMethod(ModuleBuilder builder,MethodInfo info, TypeBuilder typeBuilder, Type contextType, bool defaultImp =true)
+ private static void MakeMethod(ModuleBuilder builder,MethodInfo info, TypeBuilder typeBuilder, Type contextType, bool nonRecursive= false, bool defaultImp =true)
{
- var tEmitInfo = new MethodEmitInfo {Name = info.Name, DefaultInterfaceImplementation = defaultImp};
+ var tEmitInfo = new MethodEmitInfo {Name = info.Name, DefaultInterfaceImplementation = defaultImp, NonRecursive = nonRecursive};
@@ -710,7 +719,10 @@ MethodEmitInfo emitInfo
tIlGen.Emit(OpCodes.Stsfld, tInvokeField);
}
- if (emitInfo.ResolveReturnType != typeof(void) && !emitInfo.ResolveReturnType.IsInterface)
+ //If it's an interface and not nonrecursive this will be true
+ var tRecurse = emitInfo.ResolveReturnType.IsInterface && !emitInfo.NonRecursive;
+
+ if (emitInfo.ResolveReturnType != typeof(void) && !tRecurse)
{
tIlGen.Emit(OpCodes.Ldsfld, tConvertField);
tIlGen.Emit(OpCodes.Ldfld, typeof(CallSite<>).MakeGenericType(emitInfo.CallSiteConvertFuncType).GetFieldEvenIfGeneric("Target"));
@@ -728,13 +740,13 @@ MethodEmitInfo emitInfo
tIlGen.EmitLoadArgument(i);
}
tIlGen.EmitCallInvokeFunc(emitInfo.CallSiteInvokeFuncType);
- if (emitInfo.ResolveReturnType != typeof(void) && !emitInfo.ResolveReturnType.IsInterface)
+ if (emitInfo.ResolveReturnType != typeof(void) && !tRecurse)
{
tIlGen.EmitCallInvokeFunc(emitInfo.CallSiteConvertFuncType);
}
- //If return type is interface and instance is not interface, try actlike
- if (emitInfo.ResolveReturnType.IsInterface)
+ //If we are recursing, try actlike
+ if (tRecurse)
{
var tReturnLocal = tIlGen.DeclareLocal(typeof(object));
tIlGen.EmitStoreLocation(tReturnLocal.LocalIndex);
@@ -761,7 +773,7 @@ MethodEmitInfo emitInfo
}
- private static void MakeProperty(ModuleBuilder builder,PropertyInfo info, TypeBuilder typeBuilder, Type contextType, bool defaultImp =true)
+ private static void MakeProperty(ModuleBuilder builder,PropertyInfo info, TypeBuilder typeBuilder, Type contextType, bool nonRecursive=false, bool defaultImp =true)
{
var tGetMethod = info.GetGetMethod();
@@ -772,7 +784,9 @@ private static void MakeProperty(ModuleBuilder builder,PropertyInfo info, TypeBu
ResolveReturnType = tGetMethod.ReturnType,
GetName = tGetMethod.Name,
ContextType = contextType,
- DefaultInterfaceImplementation = defaultImp};
+ DefaultInterfaceImplementation = defaultImp,
+ NonRecursive = nonRecursive
+ };
@@ -1273,7 +1287,7 @@ public string CallSiteName
{
get { return _callSiteName.Value; }
}
-
+ public bool NonRecursive { get; set; }
public bool DefaultInterfaceImplementation { get; set; }
public IEnumerable<string> ArgNames { get; set; }
public Type[] ResolvedParamTypes { get; set; }
@@ -1290,8 +1304,8 @@ public MethodEmitInfo()
CallSiteInvokeName = "Invoke_Method";
CallSiteConvertName = "Convert_Method";
}
-
+
public string CallSiteInvokeName { get; protected set; }
public string CallSiteConvertName { get; protected set; }
@@ -1316,8 +1330,11 @@ PropertyEmitInfo emitInfo
var tConvertCallsiteField = emitInfo.CallSiteType.GetFieldEvenIfGeneric(emitInfo.CallSiteConvertName);
+ //If it's an interface and not nonrecursive this will be true
+ var tRecurse = emitInfo.ResolveReturnType.IsInterface && !emitInfo.NonRecursive;
+
//If we want to do recursive Interfaces we need to test the interface before we dynamically cast
- var tReturnLocal = tIlGen.DeclareLocal(emitInfo.ResolveReturnType.IsInterface? typeof(object) : emitInfo.ResolveReturnType);
+ var tReturnLocal = tIlGen.DeclareLocal(tRecurse ? typeof(object) : emitInfo.ResolveReturnType);
using (tIlGen.EmitBranchTrue(gen => gen.Emit(OpCodes.Ldsfld, tConvertCallsiteField)))
@@ -1337,8 +1354,9 @@ PropertyEmitInfo emitInfo
}
- //If it's an interface we do this later.
- if (!emitInfo.ResolveReturnType.IsInterface)
+
+
+ if (!tRecurse)
{
tIlGen.Emit(OpCodes.Ldsfld, tConvertCallsiteField);
tIlGen.Emit(OpCodes.Ldfld, tConvertCallsiteField.FieldType.GetFieldEvenIfGeneric("Target"));
@@ -1355,8 +1373,8 @@ PropertyEmitInfo emitInfo
}
tIlGen.EmitCallInvokeFunc(emitInfo.CallSiteInvokeGetFuncType);
- //If it's an interface we do this later.
- if (!emitInfo.ResolveReturnType.IsInterface)
+ //If we are are recursing than do it later
+ if (!tRecurse)
{
tIlGen.EmitCallInvokeFunc(emitInfo.CallSiteConvertFuncType);
}
@@ -1365,7 +1383,7 @@ PropertyEmitInfo emitInfo
//If return type is interface and instance is not interface, try actlike
- if (emitInfo.ResolveReturnType.IsInterface)
+ if (tRecurse)
{
using (tIlGen.EmitBranchFalse(gen => gen.EmitLoadLocation(tReturnLocal.LocalIndex)))
{
@@ -1382,14 +1400,14 @@ PropertyEmitInfo emitInfo
var tReturnLabel =tIlGen.DefineLabel();
tIlGen.Emit(OpCodes.Br_S, tReturnLabel);
tIlGen.MarkLabel(tReturnLabel);
- if (emitInfo.ResolveReturnType.IsInterface)
+ if (tRecurse)
{
tIlGen.Emit(OpCodes.Ldsfld, tConvertCallsiteField);
tIlGen.Emit(OpCodes.Ldfld, tConvertCallsiteField.FieldType.GetFieldEvenIfGeneric("Target"));
tIlGen.Emit(OpCodes.Ldsfld, tConvertCallsiteField);
}
tIlGen.EmitLoadLocation(tReturnLocal.LocalIndex);
- if (emitInfo.ResolveReturnType.IsInterface)
+ if (tRecurse)
{
tIlGen.EmitCallInvokeFunc(emitInfo.CallSiteConvertFuncType);
}
View
2  NuGetBuild/Core/ImpromptuInterface.MetaData.xml
@@ -1,6 +1,6 @@
<metadata>
<id>ImpromptuInterface</id>
- <version>5.9.0</version>
+ <version>6.0.0</version>
<authors>Jay Tuley</authors>
<owners>Jay Tuley</owners>
<description>A Lightweight Duck Casting Framework for dynamic C# 4.0 (.net4 &amp; silverlight4). Includes helper methods for dynamic invocation via method and property names known only at runtime (runs faster than reflection).</description>
View
8 NuGetBuild/Core/ImpromptuInterface.Symbol.nuspec
@@ -2,7 +2,7 @@
<package>
<metadata>
<id>ImpromptuInterface</id>
- <version>5.8.0</version>
+ <version>6.0.0</version>
<authors>Jay Tuley</authors>
<owners>Jay Tuley</owners>
<description>A Lightweight Duck Casting Framework for dynamic C# 4.0 (.net4 &amp; silverlight4). Includes helper methods for dynamic invocation via method and property names known only at runtime (runs faster than reflection).</description>
@@ -22,13 +22,17 @@
<file src="..\..\..\..\ImpromptuInterface\bin\Release\Impromptu*.dll" target="lib\net40" />
<file src="..\..\..\..\ImpromptuInterface.Silverlight\bin\Release\Impromptu*.xml" target="lib\SL40" />
<file src="..\..\..\..\ImpromptuInterface.Silverlight\bin\Release\Impromptu*.dll" target="lib\SL40" />
+ <file src="..\..\..\..\ImpromptuInterface.Silverlight5\bin\Release\Impromptu*.xml" target="lib\SL50" />
+ <file src="..\..\..\..\ImpromptuInterface.Silverlight5\bin\Release\Impromptu*.dll" target="lib\SL50" />
<file src="..\..\..\..\ImpromptuInterface\bin\Release\Impromptu*.pdb" target="lib\net40" />
<file src="..\..\..\..\ImpromptuInterface.Silverlight\bin\Release\Impromptu*.pdb" target="lib\SL40" />
-
+ <file src="..\..\..\..\ImpromptuInterface.Silverlight5\bin\Release\Impromptu*.pdb" target="lib\SL50" />
<file src="..\..\..\..\ImpromptuInterface\src\**\*" target="src\src" />
<file src="..\..\..\..\ImpromptuInterface.Silverlight\src\**\*" target="src\src" />
+
+ <file src="..\..\..\..\ImpromptuInterface.Silverlight5\src\**\*" target="src\src" />
</files>
</package>
View
6 NuGetBuild/Core/ImpromptuInterface.Symbol.tt
@@ -9,13 +9,17 @@
<file src="..\..\..\..\ImpromptuInterface\bin\Release\Impromptu*.dll" target="lib\net40" />
<file src="..\..\..\..\ImpromptuInterface.Silverlight\bin\Release\Impromptu*.xml" target="lib\SL40" />
<file src="..\..\..\..\ImpromptuInterface.Silverlight\bin\Release\Impromptu*.dll" target="lib\SL40" />
+ <file src="..\..\..\..\ImpromptuInterface.Silverlight5\bin\Release\Impromptu*.xml" target="lib\SL50" />
+ <file src="..\..\..\..\ImpromptuInterface.Silverlight5\bin\Release\Impromptu*.dll" target="lib\SL50" />
<file src="..\..\..\..\ImpromptuInterface\bin\Release\Impromptu*.pdb" target="lib\net40" />
<file src="..\..\..\..\ImpromptuInterface.Silverlight\bin\Release\Impromptu*.pdb" target="lib\SL40" />
-
+ <file src="..\..\..\..\ImpromptuInterface.Silverlight5\bin\Release\Impromptu*.pdb" target="lib\SL50" />
<file src="..\..\..\..\ImpromptuInterface\src\**\*" target="src\src" />
<file src="..\..\..\..\ImpromptuInterface.Silverlight\src\**\*" target="src\src" />
+
+ <file src="..\..\..\..\ImpromptuInterface.Silverlight5\src\**\*" target="src\src" />
</files>
</package>
View
4 NuGetBuild/Core/ImpromptuInterface.nuspec
@@ -2,7 +2,7 @@
<package>
<metadata>
<id>ImpromptuInterface</id>
- <version>5.8.0</version>
+ <version>6.0.0</version>
<authors>Jay Tuley</authors>
<owners>Jay Tuley</owners>
<description>A Lightweight Duck Casting Framework for dynamic C# 4.0 (.net4 &amp; silverlight4). Includes helper methods for dynamic invocation via method and property names known only at runtime (runs faster than reflection).</description>
@@ -22,5 +22,7 @@
<file src="..\..\..\..\ImpromptuInterface\bin\Release\Impromptu*.dll" target="lib\net40" />
<file src="..\..\..\..\ImpromptuInterface.Silverlight\bin\Release\Impromptu*.xml" target="lib\SL40" />
<file src="..\..\..\..\ImpromptuInterface.Silverlight\bin\Release\Impromptu*.dll" target="lib\SL40" />
+ <file src="..\..\..\..\ImpromptuInterface.Silverlight5\bin\Release\Impromptu*.xml" target="lib\SL50" />
+ <file src="..\..\..\..\ImpromptuInterface.Silverlight5\bin\Release\Impromptu*.dll" target="lib\SL50" />
</files>
</package>
View
2  NuGetBuild/Core/ImpromptuInterface.tt
@@ -9,5 +9,7 @@
<file src="..\..\..\..\ImpromptuInterface\bin\Release\Impromptu*.dll" target="lib\net40" />
<file src="..\..\..\..\ImpromptuInterface.Silverlight\bin\Release\Impromptu*.xml" target="lib\SL40" />
<file src="..\..\..\..\ImpromptuInterface.Silverlight\bin\Release\Impromptu*.dll" target="lib\SL40" />
+ <file src="..\..\..\..\ImpromptuInterface.Silverlight5\bin\Release\Impromptu*.xml" target="lib\SL50" />
+ <file src="..\..\..\..\ImpromptuInterface.Silverlight5\bin\Release\Impromptu*.dll" target="lib\SL50" />
</files>
</package>
View
4 NuGetBuild/FSharp/ImpromptuInterface.FSharp.MetaData.xml
@@ -1,6 +1,6 @@
<metadata>
<id>ImpromptuInterface.FSharp</id>
- <version>1.1.4</version>
+ <version>1.2.0</version>
<authors>Jay Tuley</authors>
<owners>Jay Tuley</owners>
<description>A complete dlr based dynamic operator implementation for F#</description>
@@ -13,6 +13,6 @@
<frameworkAssembly assemblyName="Microsoft.CSharp" />
</frameworkAssemblies>
<dependencies>
- <dependency id="ImpromptuInterface" version="5.6.4" />
+ <dependency id="ImpromptuInterface" version="6.0.0" />
</dependencies>
</metadata>
View
12 NuGetBuild/FSharp/ImpromptuInterface.FSharp.Symbol.nuspec
@@ -2,7 +2,7 @@
<package>
<metadata>
<id>ImpromptuInterface.FSharp</id>
- <version>1.1.4</version>
+ <version>1.2.0</version>
<authors>Jay Tuley</authors>
<owners>Jay Tuley</owners>
<description>A complete dlr based dynamic operator implementation for F#</description>
@@ -15,7 +15,7 @@
<frameworkAssembly assemblyName="Microsoft.CSharp" />
</frameworkAssemblies>
<dependencies>
- <dependency id="ImpromptuInterface" version="5.6.4" />
+ <dependency id="ImpromptuInterface" version="6.0.0" />
</dependencies>
</metadata>
<files>
@@ -23,10 +23,14 @@
<file src="..\..\..\..\docs\Readme.FSharp.txt" />
<file src="..\..\..\..\ImpromptuInterface.FSharp\bin\Release\ImpromptuInterface.FSharp.xml" target="lib\net40" />
<file src="..\..\..\..\ImpromptuInterface.FSharp\bin\Release\ImpromptuInterface.FSharp.dll" target="lib\net40" />
+ <file src="..\..\..\..\ImpromptuInterface.FSharp.Silverlight\bin\Release\ImpromptuInterface.FSharp.xml" target="lib\SL40" />
+ <file src="..\..\..\..\ImpromptuInterface.FSharp.Silverlight\bin\Release\ImpromptuInterface.FSharp.dll" target="lib\SL40" />
<file src="..\..\..\..\ImpromptuInterface.FSharp\bin\Release\ImpromptuInterface.FSharp.pdb" target="lib\net40" />
-
- <file src="..\..\..\..\ImpromptuInterface.FSharp\*.fs" target="src" />
+ <file src="..\..\..\..\ImpromptuInterface.FSharp.Silverlight\bin\Release\ImpromptuInterface.FSharp.pdb" target="lib\SL40" />
+
+ <file src="..\..\..\..\ImpromptuInterface.FSharp\*.fs" target="src" />
+ <file src="..\..\..\..\ImpromptuInterface.FSharp.Silverlight\*.fs" target="src" />
</files>
</package>
View
8 NuGetBuild/FSharp/ImpromptuInterface.FSharp.Symbol.tt
@@ -7,10 +7,14 @@
<file src="..\..\..\..\docs\Readme.FSharp.txt" />
<file src="..\..\..\..\ImpromptuInterface.FSharp\bin\Release\ImpromptuInterface.FSharp.xml" target="lib\net40" />
<file src="..\..\..\..\ImpromptuInterface.FSharp\bin\Release\ImpromptuInterface.FSharp.dll" target="lib\net40" />
+ <file src="..\..\..\..\ImpromptuInterface.FSharp.Silverlight\bin\Release\ImpromptuInterface.FSharp.xml" target="lib\SL40" />
+ <file src="..\..\..\..\ImpromptuInterface.FSharp.Silverlight\bin\Release\ImpromptuInterface.FSharp.dll" target="lib\SL40" />
<file src="..\..\..\..\ImpromptuInterface.FSharp\bin\Release\ImpromptuInterface.FSharp.pdb" target="lib\net40" />
-
- <file src="..\..\..\..\ImpromptuInterface.FSharp\*.fs" target="src" />
+ <file src="..\..\..\..\ImpromptuInterface.FSharp.Silverlight\bin\Release\ImpromptuInterface.FSharp.pdb" target="lib\SL40" />
+
+ <file src="..\..\..\..\ImpromptuInterface.FSharp\*.fs" target="src" />
+ <file src="..\..\..\..\ImpromptuInterface.FSharp.Silverlight\*.fs" target="src" />
</files>
</package>
View
6 NuGetBuild/FSharp/ImpromptuInterface.FSharp.nuspec
@@ -2,7 +2,7 @@
<package>
<metadata>
<id>ImpromptuInterface.FSharp</id>
- <version>1.1.4</version>
+ <version>1.2.0</version>
<authors>Jay Tuley</authors>
<owners>Jay Tuley</owners>
<description>A complete dlr based dynamic operator implementation for F#</description>
@@ -15,7 +15,7 @@
<frameworkAssembly assemblyName="Microsoft.CSharp" />
</frameworkAssemblies>
<dependencies>
- <dependency id="ImpromptuInterface" version="5.6.4" />
+ <dependency id="ImpromptuInterface" version="6.0.0" />
</dependencies>
</metadata>
<files>
@@ -23,5 +23,7 @@
<file src="..\..\..\..\docs\Readme.FSharp.txt" />
<file src="..\..\..\..\ImpromptuInterface.FSharp\bin\Release\ImpromptuInterface.FSharp.xml" target="lib\net40" />
<file src="..\..\..\..\ImpromptuInterface.FSharp\bin\Release\ImpromptuInterface.FSharp.dll" target="lib\net40" />
+ <file src="..\..\..\..\ImpromptuInterface.FSharp.Silverlight\bin\Release\ImpromptuInterface.FSharp.xml" target="lib\SL40" />
+ <file src="..\..\..\..\ImpromptuInterface.FSharp.Silverlight\bin\Release\ImpromptuInterface.FSharp.dll" target="lib\SL40" />
</files>
</package>
View
2  NuGetBuild/FSharp/ImpromptuInterface.FSharp.tt
@@ -7,5 +7,7 @@
<file src="..\..\..\..\docs\Readme.FSharp.txt" />
<file src="..\..\..\..\ImpromptuInterface.FSharp\bin\Release\ImpromptuInterface.FSharp.xml" target="lib\net40" />
<file src="..\..\..\..\ImpromptuInterface.FSharp\bin\Release\ImpromptuInterface.FSharp.dll" target="lib\net40" />
+ <file src="..\..\..\..\ImpromptuInterface.FSharp.Silverlight\bin\Release\ImpromptuInterface.FSharp.xml" target="lib\SL40" />
+ <file src="..\..\..\..\ImpromptuInterface.FSharp.Silverlight\bin\Release\ImpromptuInterface.FSharp.dll" target="lib\SL40" />
</files>
</package>
View
4 NuGetBuild/MVVM/ImpromptuInterface.MVVM.MetaData.xml
@@ -1,6 +1,6 @@
<metadata>
<id>ImpromptuInterface.MVVM</id>
- <version>3.8.0</version>
+ <version>4.0.0</version>
<authors>Jay Tuley</authors>
<owners>Jay Tuley</owners>
<description>A Lightweight Dynamic MVVM View Model(.net4 &amp; silverlight4). Removes boilerplate code for MVVM, makes it practical to use MVVM in small apps.</description>
@@ -13,6 +13,6 @@
<frameworkAssembly assemblyName="Microsoft.CSharp" />
</frameworkAssemblies>
<dependencies>
- <dependency id="ImpromptuInterface" version="5.8.0" />
+ <dependency id="ImpromptuInterface" version="6.0.0" />
</dependencies>
</metadata>
View
10 NuGetBuild/MVVM/ImpromptuInterface.MVVM.Symbol.nuspec
@@ -2,7 +2,7 @@
<package>
<metadata>
<id>ImpromptuInterface.MVVM</id>
- <version>3.8.0</version>
+ <version>4.0.0</version>
<authors>Jay Tuley</authors>
<owners>Jay Tuley</owners>
<description>A Lightweight Dynamic MVVM View Model(.net4 &amp; silverlight4). Removes boilerplate code for MVVM, makes it practical to use MVVM in small apps.</description>
@@ -15,7 +15,7 @@
<frameworkAssembly assemblyName="Microsoft.CSharp" />
</frameworkAssemblies>
<dependencies>
- <dependency id="ImpromptuInterface" version="5.8.0" />
+ <dependency id="ImpromptuInterface" version="6.0.0" />
</dependencies>
</metadata>
<files>
@@ -25,12 +25,16 @@
<file src="..\..\..\..\ImpromptuInterface.MVVM\bin\Release\ImpromptuInterface.MVVM.dll" target="lib\net40" />
<file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight\bin\Release\ImpromptuInterface.MVVM.xml" target="lib\SL40" />
<file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight\bin\Release\ImpromptuInterface.MVVM.dll" target="lib\SL40" />
+ <file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight5\bin\Release\ImpromptuInterface.MVVM.xml" target="lib\SL50" />
+ <file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight5\bin\Release\ImpromptuInterface.MVVM.dll" target="lib\SL50" />
<file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight\bin\Release\ImpromptuInterface.MVVM.pdb" target="lib\SL40" />
<file src="..\..\..\..\ImpromptuInterface.MVVM\bin\Release\ImpromptuInterface.MVVM.pdb" target="lib\net40" />
-
+ <file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight5\bin\Release\ImpromptuInterface.MVVM.pdb" target="lib\SL50" />
+
<file src="..\..\..\..\ImpromptuInterface.MVVM\src\**\*" target="src\src" />
<file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight\src\**\*" target="src\src" />
+ <file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight5\src\**\*" target="src\src" />
</files>
</package>
View
6 NuGetBuild/MVVM/ImpromptuInterface.MVVM.Symbol.tt
@@ -9,12 +9,16 @@
<file src="..\..\..\..\ImpromptuInterface.MVVM\bin\Release\ImpromptuInterface.MVVM.dll" target="lib\net40" />
<file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight\bin\Release\ImpromptuInterface.MVVM.xml" target="lib\SL40" />
<file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight\bin\Release\ImpromptuInterface.MVVM.dll" target="lib\SL40" />
+ <file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight5\bin\Release\ImpromptuInterface.MVVM.xml" target="lib\SL50" />
+ <file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight5\bin\Release\ImpromptuInterface.MVVM.dll" target="lib\SL50" />
<file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight\bin\Release\ImpromptuInterface.MVVM.pdb" target="lib\SL40" />
<file src="..\..\..\..\ImpromptuInterface.MVVM\bin\Release\ImpromptuInterface.MVVM.pdb" target="lib\net40" />
-
+ <file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight5\bin\Release\ImpromptuInterface.MVVM.pdb" target="lib\SL50" />
+
<file src="..\..\..\..\ImpromptuInterface.MVVM\src\**\*" target="src\src" />
<file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight\src\**\*" target="src\src" />
+ <file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight5\src\**\*" target="src\src" />
</files>
</package>
View
7 NuGetBuild/MVVM/ImpromptuInterface.MVVM.nuspec
@@ -2,7 +2,7 @@
<package>
<metadata>
<id>ImpromptuInterface.MVVM</id>
- <version>3.8.0</version>
+ <version>4.0.0</version>
<authors>Jay Tuley</authors>
<owners>Jay Tuley</owners>
<description>A Lightweight Dynamic MVVM View Model(.net4 &amp; silverlight4). Removes boilerplate code for MVVM, makes it practical to use MVVM in small apps.</description>
@@ -15,7 +15,7 @@
<frameworkAssembly assemblyName="Microsoft.CSharp" />
</frameworkAssemblies>
<dependencies>
- <dependency id="ImpromptuInterface" version="5.8.0" />
+ <dependency id="ImpromptuInterface" version="6.0.0" />
</dependencies>
</metadata>
<files>
@@ -25,6 +25,7 @@
<file src="..\..\..\..\ImpromptuInterface.MVVM\bin\Release\ImpromptuInterface.MVVM.dll" target="lib\net40" />
<file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight\bin\Release\ImpromptuInterface.MVVM.xml" target="lib\SL40" />
<file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight\bin\Release\ImpromptuInterface.MVVM.dll" target="lib\SL40" />
-
+ <file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight5\bin\Release\ImpromptuInterface.MVVM.xml" target="lib\SL50" />
+ <file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight5\bin\Release\ImpromptuInterface.MVVM.dll" target="lib\SL50" />
</files>
</package>
View
3  NuGetBuild/MVVM/ImpromptuInterface.MVVM.tt
@@ -9,6 +9,7 @@
<file src="..\..\..\..\ImpromptuInterface.MVVM\bin\Release\ImpromptuInterface.MVVM.dll" target="lib\net40" />
<file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight\bin\Release\ImpromptuInterface.MVVM.xml" target="lib\SL40" />
<file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight\bin\Release\ImpromptuInterface.MVVM.dll" target="lib\SL40" />
-
+ <file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight5\bin\Release\ImpromptuInterface.MVVM.xml" target="lib\SL50" />
+ <file src="..\..\..\..\ImpromptuInterface.MVVM.Silverlight5\bin\Release\ImpromptuInterface.MVVM.dll" target="lib\SL50" />
</files>
</package>
View
2  Tests/UnitTestImpromptuInterface.SelfRunner/Support/Helper.cs
@@ -193,7 +193,7 @@ public void Fail(string message)
throw new AssertionException(message);
}
- public void Throws<T>(Func<object> func) where T:Exception
+ public void Throws<T>(Action func) where T:Exception
{
var tFail = true;
try
View
42 Tests/UnitTestImpromptuInterface/Basic.cs
@@ -168,6 +168,48 @@ public void NestedInterfacetest()
}
[Test]
+ public void NonNestedInterfaceTest()
+ {
+ dynamic tNew = new ExpandoObject();
+ dynamic tNew2 = new ExpandoObject();
+ tNew.NameLevel1 = "one";
+ tNew.Nested = new ExpandoObject();
+ tNew.Nested2 = new Func<object>(() => tNew2);
+
+ INonNest tActsLike = Impromptu.ActLike(tNew);
+
+ Assert.AreEqual(tNew.NameLevel1, tActsLike.NameLevel1);
+ Assert.Throws<RuntimeBinderException>(() => { var tval= tActsLike.Nested; });
+ Assert.Throws<RuntimeBinderException>(() =>
+ {
+ var tval = tActsLike.Nested2();
+ ;
+ });
+ }
+
+ [Test]
+ public void PartialNonNestedInterfaceTest()
+ {
+ dynamic tNew = new ExpandoObject();
+ dynamic tNew2 = new ExpandoObject();
+ tNew.NameLevel1 = "one";
+
+ tNew.Nested = new ExpandoObject();
+ tNew.Nested2 = new Func<object>(() => tNew2);
+ tNew.Nested.NameLevel2 = "two";
+
+ INonPartialNest tActsLike = Impromptu.ActLike(tNew);
+
+ Assert.AreEqual(tNew.NameLevel1, tActsLike.NameLevel1);
+ Assert.Throws<RuntimeBinderException>(() =>
+ {
+ var tVal2 = tActsLike.Nested2();
+ ;
+ });
+ Assert.AreEqual(tNew.Nested.NameLevel2, tActsLike.Nested.NameLevel2);
+ }
+
+ [Test]
public void NestedInterfaceMethodtest()
{
dynamic tNew = new ExpandoObject();
View
21 Tests/UnitTestImpromptuInterface/Support/SupportDefinitions.cs
@@ -395,8 +395,25 @@ public interface IBuilder{
INest Nester(string NameLevel1, INested Nested);
INested Nester2([UseNamedArgument]string NameLevel2);
- }
-
+ }
+
+ [NonRecursiveInterface]
+ public interface INonNest
+ {
+ String NameLevel1 { get; set; }
+ INested Nested { get; set; }
+ INested Nested2();
+ }
+
+ public interface INonPartialNest
+ {
+ String NameLevel1 { get; set; }
+ INested Nested { get; set; }
+
+ [NonRecursiveInterface]
+ INested Nested2();
+ }
+
public interface INest
{
String NameLevel1 {get;set;}

0 comments on commit 72e2537

Please sign in to comment.
Something went wrong with that request. Please try again.