Free cookie consent management tool by TermsFeed Policy Generator

Changeset 694 for trunk


Ignore:
Timestamp:
10/19/08 02:11:33 (16 years ago)
Author:
gkronber
Message:

fixed #315 (Support for LINQ extensions in ProgrammableOperator)

Location:
trunk/sources/HeuristicLab.Operators.Programmable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Programmable/HeuristicLab.Operators.Programmable.csproj

    r582 r694  
    33    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    44    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    5     <ProductVersion>9.0.30729</ProductVersion>
     5    <ProductVersion>9.0.21022</ProductVersion>
    66    <SchemaVersion>2.0</SchemaVersion>
    77    <ProjectGuid>{E3CCBFC6-900C-41B6-AFB8-6646DB097435}</ProjectGuid>
     
    1717    <UpgradeBackupLocation>
    1818    </UpgradeBackupLocation>
     19    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    1920  </PropertyGroup>
    2021  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     
    5556  <ItemGroup>
    5657    <Reference Include="System" />
     58    <Reference Include="System.Core">
     59      <RequiredTargetFramework>3.5</RequiredTargetFramework>
     60    </Reference>
    5761    <Reference Include="System.Data" />
     62    <Reference Include="System.Data.Linq">
     63      <RequiredTargetFramework>3.5</RequiredTargetFramework>
     64    </Reference>
    5865    <Reference Include="System.Drawing" />
    5966    <Reference Include="System.Windows.Forms" />
  • trunk/sources/HeuristicLab.Operators.Programmable/ProgrammableOperator.cs

    r679 r694  
    2525using System.Xml;
    2626using System.IO;
     27using System.Linq;
    2728using System.Reflection;
    2829using System.CodeDom;
     
    3233using HeuristicLab.Core;
    3334using HeuristicLab.Data;
     35using System.Data.Linq;
    3436
    3537namespace HeuristicLab.Operators.Programmable {
     
    5658      myCode = "Result.Data = true;";
    5759      myDescription = "An operator that can be programmed for arbitrary needs.";
    58 
    5960      AddVariableInfo(new VariableInfo("Result", "A computed variable", typeof(BoolData), VariableKind.New | VariableKind.Out));
    6061      executeMethod = null;
     
    9495      ns.Imports.Add(new CodeNamespaceImport("System.Text"));
    9596      ns.Imports.Add(new CodeNamespaceImport("System.Linq"));
     97      ns.Imports.Add(new CodeNamespaceImport("System.Data.Linq"));
    9698      ns.Imports.Add(new CodeNamespaceImport("HeuristicLab.Core"));
    9799      foreach (IVariableInfo variableInfo in VariableInfos)
     
    107109      foreach (Assembly loadedAssembly in loadedAssemblies)
    108110        parameters.ReferencedAssemblies.Add(loadedAssembly.Location);
    109       CodeDomProvider provider = new CSharpCodeProvider();
     111      parameters.ReferencedAssemblies.Add(typeof(Enumerable).Assembly.Location); // add reference to version 3.5 of System.dll
     112      parameters.ReferencedAssemblies.Add(typeof(DataContext).Assembly.Location); // add reference System.Data.Linq.Dll
     113      CodeDomProvider provider = new CSharpCodeProvider(new Dictionary<string, string>() { { "CompilerVersion", "v3.5" } });  // support C# 3.0 syntax
    110114      CompilerResults results = provider.CompileAssemblyFromDom(parameters, unit);
    111115
Note: See TracChangeset for help on using the changeset viewer.