Skip to content

Commit

Permalink
Convert Obops
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlopez committed Jun 14, 2014
1 parent d9489cc commit 03cfd82
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Src/Mass.Console/Mass.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Mass.Console</RootNamespace>
<AssemblyName>mass</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand All @@ -31,6 +31,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -112,6 +113,9 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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.
Expand Down
3 changes: 3 additions & 0 deletions Src/Mass.Console/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
13 changes: 13 additions & 0 deletions Src/Mass.Core/Expressions/BinaryArithmeticExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,18 @@ private static object Add(object left, object right)

return Operators.AddObject(left, right);
}

private abstract class BinaryExpressionBuilder<T1, T2>
{
public Func<object, object, object> BuildExpression()
{
var x = System.Linq.Expressions.Expression.Parameter(typeof(T1), "x");
var y = System.Linq.Expressions.Expression.Parameter(typeof(T2), "y");
var add = System.Linq.Expressions.Expression.Add(System.Linq.Expressions.Expression.Unbox(x, typeof(T2)), System.Linq.Expressions.Expression.Unbox(y, typeof(T2)));
var body = System.Linq.Expressions.Expression.TypeAs(add, typeof(object));
var lambda = System.Linq.Expressions.Expression.Lambda<Func<object, object, object>>(body, x, y).Compile();
return lambda;
}
}
}
}
3 changes: 2 additions & 1 deletion Src/Mass.Core/Mass.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Mass.Core</RootNamespace>
<AssemblyName>Mass.Core</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand All @@ -31,6 +31,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down

0 comments on commit 03cfd82

Please sign in to comment.