Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/18/15 10:54:32 (10 years ago)
Author:
bburlacu
Message:

#2276: Merged trunk changes.

Location:
branches/HeuristicLab.DatasetRefactor/sources
Files:
2 deleted
8 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.DatasetRefactor/sources

  • branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting/3.3/HeuristicLab.Scripting-3.3.csproj

    r11078 r12031  
    1010    <RootNamespace>HeuristicLab.Scripting</RootNamespace>
    1111    <AssemblyName>HeuristicLab.Scripting-3.3</AssemblyName>
    12     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     12    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    1313    <FileAlignment>512</FileAlignment>
    1414    <TargetFrameworkProfile />
     
    2323    <WarningLevel>4</WarningLevel>
    2424    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     25    <Prefer32Bit>false</Prefer32Bit>
    2526  </PropertyGroup>
    2627  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     
    3132    <ErrorReport>prompt</ErrorReport>
    3233    <WarningLevel>4</WarningLevel>
     34    <Prefer32Bit>false</Prefer32Bit>
    3335  </PropertyGroup>
    3436  <PropertyGroup>
     
    4648    <ErrorReport>prompt</ErrorReport>
    4749    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     50    <Prefer32Bit>false</Prefer32Bit>
    4851  </PropertyGroup>
    4952  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
     
    5558    <ErrorReport>prompt</ErrorReport>
    5659    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     60    <Prefer32Bit>false</Prefer32Bit>
    5761  </PropertyGroup>
    5862  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     
    6468    <ErrorReport>prompt</ErrorReport>
    6569    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     70    <Prefer32Bit>false</Prefer32Bit>
    6671  </PropertyGroup>
    6772  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     
    7378    <ErrorReport>prompt</ErrorReport>
    7479    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     80    <Prefer32Bit>false</Prefer32Bit>
    7581  </PropertyGroup>
    7682  <ItemGroup>
     
    8591  </ItemGroup>
    8692  <ItemGroup>
    87     <Compile Include="CSharpScript.cs" />
     93    <Compile Include="CompilationException.cs" />
     94    <Compile Include="Scripts\CSharp\CSharpScript.cs" />
     95    <Compile Include="Scripts\Templates\CSharpScriptTemplate.cs" />
     96    <Compile Include="Scripts\Templates\ScriptTemplates.Designer.cs">
     97      <AutoGen>True</AutoGen>
     98      <DesignTime>True</DesignTime>
     99      <DependentUpon>ScriptTemplates.resx</DependentUpon>
     100    </Compile>
    88101    <Compile Include="Variables.cs" />
    89102    <Compile Include="VariableStore.cs" />
    90103    <None Include="Plugin.cs.frame" />
    91104    <Compile Include="Script.cs" />
    92     <Compile Include="CSharpScriptBase.cs" />
     105    <Compile Include="Scripts\CSharp\CSharpScriptBase.cs" />
    93106    <Compile Include="Plugin.cs" />
    94107    <Compile Include="Properties\AssemblyInfo.cs" />
     
    130143    </ProjectReference>
    131144  </ItemGroup>
     145  <ItemGroup>
     146    <EmbeddedResource Include="Scripts\Templates\ScriptTemplates.resx">
     147      <Generator>ResXFileCodeGenerator</Generator>
     148      <LastGenOutput>ScriptTemplates.Designer.cs</LastGenOutput>
     149      <CustomToolNamespace>HeuristicLab.Scripting</CustomToolNamespace>
     150    </EmbeddedResource>
     151  </ItemGroup>
    132152  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    133    <PropertyGroup>
     153  <PropertyGroup>
    134154    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    135155set ProjectDir=$(ProjectDir)
  • branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting/3.3/Plugin.cs.frame

    r11174 r12031  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2323
    2424namespace HeuristicLab.Scripting {
    25   [Plugin("HeuristicLab.Scripting", "3.3.10.$WCREV$")]
     25  [Plugin("HeuristicLab.Scripting", "3.3.11.$WCREV$")]
    2626  [PluginFile("HeuristicLab.Scripting-3.3.dll", PluginFileType.Assembly)]
    2727  [PluginDependency("HeuristicLab.Collections", "3.3")]
  • branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting/3.3/Properties/AssemblyInfo.cs.frame

    r11174 r12031  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3232[assembly: AssemblyCompany("")]
    3333[assembly: AssemblyProduct("HeuristicLab")]
    34 [assembly: AssemblyCopyright("(c) 2002-2014 HEAL")]
     34[assembly: AssemblyCopyright("(c) 2002-2015 HEAL")]
    3535[assembly: AssemblyTrademark("")]
    3636[assembly: AssemblyCulture("")]
     
    5555// [assembly: AssemblyVersion("1.0.*")]
    5656[assembly: AssemblyVersion("3.3.0.0")]
    57 [assembly: AssemblyFileVersion("3.3.10.$WCREV$")]
     57[assembly: AssemblyFileVersion("3.3.11.$WCREV$")]
  • branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting/3.3/Script.cs

    r11477 r12031  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2424using System.CodeDom.Compiler;
    2525using System.Collections.Generic;
    26 using System.Diagnostics;
    2726using System.Drawing;
    2827using System.IO;
     
    8079    public Script()
    8180      : base("Script", "An empty script.") {
    82       code = string.Empty;
     81      code = CodeTemplate;
    8382    }
    8483    public Script(string code)
     
    109108        WarningLevel = 4
    110109      };
     110
    111111      parameters.ReferencedAssemblies.AddRange(
    112112        GetAssemblies()
    113113        .Select(a => a.Location)
    114114        .ToArray());
    115       var unit = CreateCompilationUnit();
    116       var writer = new StringWriter();
    117       CodeProvider.GenerateCodeFromCompileUnit(
    118         unit,
    119         writer,
    120         new CodeGeneratorOptions {
    121           ElseOnClosing = true,
    122           IndentString = "  ",
    123         });
    124       return CodeProvider.CompileAssemblyFromDom(parameters, unit);
     115
     116      return CodeProvider.CompileAssemblyFromSource(parameters, code);
    125117    }
    126118
     
    135127            .AppendLine(error.ErrorText);
    136128        }
    137         throw new Exception(string.Format("Compilation of \"{0}\" failed:{1}{2}",
     129        throw new CompilationException(string.Format("Compilation of \"{0}\" failed:{1}{2}",
    138130          Name, Environment.NewLine, sb.ToString()));
    139131      } else {
     
    143135
    144136    public virtual IEnumerable<Assembly> GetAssemblies() {
    145       var assemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic && File.Exists(a.Location)).ToList();   
     137      var assemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic && File.Exists(a.Location)).ToList();
    146138      assemblies.Add(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly); // for dlr functionality
    147139      return assemblies;
  • branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting/3.3/UserScriptBase.cs

    r10566 r12031  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting/3.3/VariableStore.cs

    r11066 r12031  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2121
    2222using System;
     23using System.Drawing;
    2324using System.IO;
    2425using HeuristicLab.Collections;
    2526using HeuristicLab.Common;
     27using HeuristicLab.Common.Resources;
    2628using HeuristicLab.Core;
    2729using HeuristicLab.Persistence.Core;
     
    3234  [Item("VariableStore", "Represents a variable store.")]
    3335  [StorableClass]
    34   public class VariableStore : ObservableDictionary<string, object>, IContent, IDeepCloneable {
     36  public class VariableStore : ObservableDictionary<string, object>, IItem {
     37    #region Properties
     38    public virtual string ItemName {
     39      get { return ItemAttribute.GetName(GetType()); }
     40    }
     41    public virtual string ItemDescription {
     42      get { return ItemAttribute.GetDescription(GetType()); }
     43    }
     44    public Version ItemVersion {
     45      get { return ItemAttribute.GetVersion(GetType()); }
     46    }
     47    public static Image StaticItemImage {
     48      get { return VSImageLibrary.Class; }
     49    }
     50    public virtual Image ItemImage {
     51      get { return ItemAttribute.GetImage(GetType()); }
     52    }
     53    #endregion
     54
     55    #region Constructors & Cloning
    3556    [StorableConstructor]
    3657    protected VariableStore(bool deserializing) : base(deserializing) { }
     
    6889      }
    6990    }
     91    #endregion
     92
     93    #region Overrides
     94    public override string ToString() {
     95      return ItemName;
     96    }
     97    #endregion
     98
     99    #region Events
     100    public event EventHandler ItemImageChanged;
     101    protected virtual void OnItemImageChanged() {
     102      var handler = ItemImageChanged;
     103      if (handler != null) handler(this, EventArgs.Empty);
     104    }
     105    public event EventHandler ToStringChanged;
     106    protected virtual void OnToStringChanged() {
     107      var handler = ToStringChanged;
     108      if (handler != null) handler(this, EventArgs.Empty);
     109    }
     110    #endregion
    70111  }
    71112}
  • branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting/3.3/Variables.cs

    r11135 r12031  
    66  public class Variables : DynamicObject, IEnumerable<KeyValuePair<string, object>> {
    77    private readonly VariableStore variableStore;
     8
     9    public IEnumerable<string> Keys {
     10      get { return variableStore.Keys; }
     11    }
     12
     13    public IEnumerable<object> Values {
     14      get { return variableStore.Values; }
     15    }
    816
    917    public Variables(VariableStore variableStore) {
Note: See TracChangeset for help on using the changeset viewer.