Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/20/15 16:41:14 (10 years ago)
Author:
dglaser
Message:

#2388 merged trunk into hive statistics branch

Location:
branches/HiveStatistics/sources
Files:
2 deleted
15 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources

  • TabularUnified branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/HeuristicLab.Scripting-3.3.csproj

    r11078 r12395  
    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)
  • TabularUnified branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Plugin.cs.frame

    r11174 r12395  
    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")]
  • TabularUnified branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Properties/AssemblyInfo.cs.frame

    r11174 r12395  
    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$")]
  • TabularUnified branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Script.cs

    r10857 r12395  
    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.
     
    7979    public Script()
    8080      : base("Script", "An empty script.") {
    81       code = string.Empty;
     81      code = CodeTemplate;
    8282    }
    8383    public Script(string code)
     
    108108        WarningLevel = 4
    109109      };
     110
    110111      parameters.ReferencedAssemblies.AddRange(
    111112        GetAssemblies()
    112113        .Select(a => a.Location)
    113114        .ToArray());
    114       var unit = CreateCompilationUnit();
    115       var writer = new StringWriter();
    116       CodeProvider.GenerateCodeFromCompileUnit(
    117         unit,
    118         writer,
    119         new CodeGeneratorOptions {
    120           ElseOnClosing = true,
    121           IndentString = "  ",
    122         });
    123       return CodeProvider.CompileAssemblyFromDom(parameters, unit);
     115
     116      return CodeProvider.CompileAssemblyFromSource(parameters, code);
    124117    }
    125118
     
    134127            .AppendLine(error.ErrorText);
    135128        }
    136         throw new Exception(string.Format("Compilation of \"{0}\" failed:{1}{2}",
     129        throw new CompilationException(string.Format("Compilation of \"{0}\" failed:{1}{2}",
    137130          Name, Environment.NewLine, sb.ToString()));
    138131      } else {
     
    142135
    143136    public virtual IEnumerable<Assembly> GetAssemblies() {
    144       var assemblies = new List<Assembly>();
    145       foreach (var a in AppDomain.CurrentDomain.GetAssemblies()) {
    146         try {
    147           if (File.Exists(a.Location)) assemblies.Add(a);
    148         } catch (NotSupportedException) {
    149           // NotSupportedException is thrown while accessing
    150           // the Location property of the anonymously hosted
    151           // dynamic methods assembly, which is related to
    152           // LINQ queries
    153         }
    154       }
     137      var assemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic && File.Exists(a.Location)).ToList();
    155138      assemblies.Add(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly); // for dlr functionality
    156139      return assemblies;
  • branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Scripts/CSharp

    • Property svn:mergeinfo set to (toggle deleted branches)
      /stable/HeuristicLab.Scripting/3.3/Scripts/CSharpmergedeligible
      /trunk/sources/HeuristicLab.Scripting/3.3/Scripts/CSharpmergedeligible
  • branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScript.cs

    • Property svn:mergeinfo set to (toggle deleted branches)
      /stable/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScript.csmergedeligible
      /trunk/sources/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScript.csmergedeligible
  • branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScriptBase.cs

    • Property svn:mergeinfo set to (toggle deleted branches)
      /stable/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScriptBase.csmergedeligible
      /trunk/sources/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScriptBase.csmergedeligible
  • branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Scripts/Templates

    • Property svn:mergeinfo set to (toggle deleted branches)
      /stable/HeuristicLab.Scripting/3.3/Scripts/Templatesmergedeligible
      /trunk/sources/HeuristicLab.Scripting/3.3/Scripts/Templatesmergedeligible
  • branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Scripts/Templates/CSharpScriptTemplate.cs

    • Property svn:mergeinfo set to (toggle deleted branches)
      /stable/HeuristicLab.Scripting/3.3/Scripts/Templates/CSharpScriptTemplate.csmergedeligible
      /trunk/sources/HeuristicLab.Scripting/3.3/Scripts/Templates/CSharpScriptTemplate.csmergedeligible
  • branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Scripts/Templates/ScriptTemplates.Designer.cs

    • Property svn:mergeinfo set to (toggle deleted branches)
      /stable/HeuristicLab.Scripting/3.3/Scripts/Templates/ScriptTemplates.Designer.csmergedeligible
      /trunk/sources/HeuristicLab.Scripting/3.3/Scripts/Templates/ScriptTemplates.Designer.csmergedeligible
  • branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Scripts/Templates/ScriptTemplates.resx

    • Property svn:mergeinfo set to (toggle deleted branches)
      /stable/HeuristicLab.Scripting/3.3/Scripts/Templates/ScriptTemplates.resxmergedeligible
      /trunk/sources/HeuristicLab.Scripting/3.3/Scripts/Templates/ScriptTemplates.resxmergedeligible
  • TabularUnified branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/UserScriptBase.cs

    r10566 r12395  
    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.
  • TabularUnified branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/VariableStore.cs

    r11066 r12395  
    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}
  • TabularUnified branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Variables.cs

    r11135 r12395  
    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.