Changeset 12395 for branches/HiveStatistics/sources/HeuristicLab.Scripting
- Timestamp:
- 05/20/15 16:41:14 (10 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 2 deleted
- 15 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources ¶
- Property svn:mergeinfo changed
-
TabularUnified branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/HeuristicLab.Scripting-3.3.csproj ¶
r11078 r12395 10 10 <RootNamespace>HeuristicLab.Scripting</RootNamespace> 11 11 <AssemblyName>HeuristicLab.Scripting-3.3</AssemblyName> 12 <TargetFrameworkVersion>v4. 0</TargetFrameworkVersion>12 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 13 13 <FileAlignment>512</FileAlignment> 14 14 <TargetFrameworkProfile /> … … 23 23 <WarningLevel>4</WarningLevel> 24 24 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 25 <Prefer32Bit>false</Prefer32Bit> 25 26 </PropertyGroup> 26 27 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> … … 31 32 <ErrorReport>prompt</ErrorReport> 32 33 <WarningLevel>4</WarningLevel> 34 <Prefer32Bit>false</Prefer32Bit> 33 35 </PropertyGroup> 34 36 <PropertyGroup> … … 46 48 <ErrorReport>prompt</ErrorReport> 47 49 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 50 <Prefer32Bit>false</Prefer32Bit> 48 51 </PropertyGroup> 49 52 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> … … 55 58 <ErrorReport>prompt</ErrorReport> 56 59 <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> 60 <Prefer32Bit>false</Prefer32Bit> 57 61 </PropertyGroup> 58 62 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> … … 64 68 <ErrorReport>prompt</ErrorReport> 65 69 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 70 <Prefer32Bit>false</Prefer32Bit> 66 71 </PropertyGroup> 67 72 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> … … 73 78 <ErrorReport>prompt</ErrorReport> 74 79 <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> 80 <Prefer32Bit>false</Prefer32Bit> 75 81 </PropertyGroup> 76 82 <ItemGroup> … … 85 91 </ItemGroup> 86 92 <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> 88 101 <Compile Include="Variables.cs" /> 89 102 <Compile Include="VariableStore.cs" /> 90 103 <None Include="Plugin.cs.frame" /> 91 104 <Compile Include="Script.cs" /> 92 <Compile Include=" CSharpScriptBase.cs" />105 <Compile Include="Scripts\CSharp\CSharpScriptBase.cs" /> 93 106 <Compile Include="Plugin.cs" /> 94 107 <Compile Include="Properties\AssemblyInfo.cs" /> … … 130 143 </ProjectReference> 131 144 </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> 132 152 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 133 153 <PropertyGroup> 134 154 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 135 155 set ProjectDir=$(ProjectDir) -
TabularUnified branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Plugin.cs.frame ¶
r11174 r12395 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 24 24 namespace HeuristicLab.Scripting { 25 [Plugin("HeuristicLab.Scripting", "3.3.1 0.$WCREV$")]25 [Plugin("HeuristicLab.Scripting", "3.3.11.$WCREV$")] 26 26 [PluginFile("HeuristicLab.Scripting-3.3.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.Collections", "3.3")] -
TabularUnified branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Properties/AssemblyInfo.cs.frame ¶
r11174 r12395 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 32 32 [assembly: AssemblyCompany("")] 33 33 [assembly: AssemblyProduct("HeuristicLab")] 34 [assembly: AssemblyCopyright("(c) 2002-201 4HEAL")]34 [assembly: AssemblyCopyright("(c) 2002-2015 HEAL")] 35 35 [assembly: AssemblyTrademark("")] 36 36 [assembly: AssemblyCulture("")] … … 55 55 // [assembly: AssemblyVersion("1.0.*")] 56 56 [assembly: AssemblyVersion("3.3.0.0")] 57 [assembly: AssemblyFileVersion("3.3.1 0.$WCREV$")]57 [assembly: AssemblyFileVersion("3.3.11.$WCREV$")] -
TabularUnified branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Script.cs ¶
r10857 r12395 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 79 79 public Script() 80 80 : base("Script", "An empty script.") { 81 code = string.Empty;81 code = CodeTemplate; 82 82 } 83 83 public Script(string code) … … 108 108 WarningLevel = 4 109 109 }; 110 110 111 parameters.ReferencedAssemblies.AddRange( 111 112 GetAssemblies() 112 113 .Select(a => a.Location) 113 114 .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); 124 117 } 125 118 … … 134 127 .AppendLine(error.ErrorText); 135 128 } 136 throw new Exception(string.Format("Compilation of \"{0}\" failed:{1}{2}",129 throw new CompilationException(string.Format("Compilation of \"{0}\" failed:{1}{2}", 137 130 Name, Environment.NewLine, sb.ToString())); 138 131 } else { … … 142 135 143 136 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(); 155 138 assemblies.Add(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly); // for dlr functionality 156 139 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/CSharp merged eligible /trunk/sources/HeuristicLab.Scripting/3.3/Scripts/CSharp merged eligible
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScript.cs ¶
-
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.cs merged eligible /trunk/sources/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScriptBase.cs merged eligible
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Scripts/Templates ¶
-
branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Scripts/Templates/CSharpScriptTemplate.cs ¶
-
branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Scripts/Templates/ScriptTemplates.Designer.cs ¶
-
branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Scripts/Templates/ScriptTemplates.resx ¶
-
TabularUnified branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/UserScriptBase.cs ¶
r10566 r12395 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
TabularUnified branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/VariableStore.cs ¶
r11066 r12395 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System; 23 using System.Drawing; 23 24 using System.IO; 24 25 using HeuristicLab.Collections; 25 26 using HeuristicLab.Common; 27 using HeuristicLab.Common.Resources; 26 28 using HeuristicLab.Core; 27 29 using HeuristicLab.Persistence.Core; … … 32 34 [Item("VariableStore", "Represents a variable store.")] 33 35 [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 35 56 [StorableConstructor] 36 57 protected VariableStore(bool deserializing) : base(deserializing) { } … … 68 89 } 69 90 } 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 70 111 } 71 112 } -
TabularUnified branches/HiveStatistics/sources/HeuristicLab.Scripting/3.3/Variables.cs ¶
r11135 r12395 6 6 public class Variables : DynamicObject, IEnumerable<KeyValuePair<string, object>> { 7 7 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 } 8 16 9 17 public Variables(VariableStore variableStore) {
Note: See TracChangeset
for help on using the changeset viewer.