Changeset 10506 for trunk/sources
- Timestamp:
- 02/25/14 13:55:01 (11 years ago)
- Location:
- trunk/sources
- Files:
-
- 12 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab 3.3.sln
r10391 r10506 384 384 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Trading.Views-3.4", "HeuristicLab.Problems.DataAnalysis.Trading.Views\3.4\HeuristicLab.Problems.DataAnalysis.Trading.Views-3.4.csproj", "{CB3D0A1E-1BE8-476B-A53C-2B189E30064F}" 385 385 EndProject 386 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab. HLScript-3.3", "HeuristicLab.HLScript\3.3\HeuristicLab.HLScript-3.3.csproj", "{21977CC3-1757-4B3B-87BD-FF817AAA900F}"387 EndProject 388 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab. HLScript.Views-3.3", "HeuristicLab.HLScript.Views\3.3\HeuristicLab.HLScript.Views-3.3.csproj", "{0C2917C8-7AA8-4E18-800A-C4D064F992ED}"386 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Scripting-3.3", "HeuristicLab.HLScript\3.3\HeuristicLab.Scripting-3.3.csproj", "{21977CC3-1757-4B3B-87BD-FF817AAA900F}" 387 EndProject 388 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Scripting.Views-3.3", "HeuristicLab.HLScript.Views\3.3\HeuristicLab.Scripting.Views-3.3.csproj", "{0C2917C8-7AA8-4E18-800A-C4D064F992ED}" 389 389 EndProject 390 390 Global -
trunk/sources/HeuristicLab.HLScript.Views/3.3/HeuristicLab.Scripting.Views-3.3.csproj
r10501 r10506 8 8 <OutputType>Library</OutputType> 9 9 <AppDesignerFolder>Properties</AppDesignerFolder> 10 <RootNamespace>HeuristicLab. HLScript.Views</RootNamespace>11 <AssemblyName>HeuristicLab. HLScript.Views-3.3</AssemblyName>10 <RootNamespace>HeuristicLab.Scripting.Views</RootNamespace> 11 <AssemblyName>HeuristicLab.Scripting.Views-3.3</AssemblyName> 12 12 <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 13 13 <FileAlignment>512</FileAlignment> … … 136 136 <Private>False</Private> 137 137 </ProjectReference> 138 <ProjectReference Include="..\..\HeuristicLab.HLScript\3.3\HeuristicLab. HLScript-3.3.csproj">138 <ProjectReference Include="..\..\HeuristicLab.HLScript\3.3\HeuristicLab.Scripting-3.3.csproj"> 139 139 <Project>{21977cc3-1757-4b3b-87bd-ff817aaa900f}</Project> 140 <Name>HeuristicLab. HLScript-3.3</Name>140 <Name>HeuristicLab.Scripting-3.3</Name> 141 141 <Private>False</Private> 142 142 </ProjectReference> -
trunk/sources/HeuristicLab.HLScript.Views/3.3/Plugin.cs.frame
r10358 r10506 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using HeuristicLab.PluginInfrastructure; 23 23 24 namespace HeuristicLab. HLScript.Views {25 [Plugin("HeuristicLab. HLScript.Views", "3.3.9.$WCREV$")]26 [PluginFile("HeuristicLab. HLScript.Views-3.3.dll", PluginFileType.Assembly)]24 namespace HeuristicLab.Scripting.Views { 25 [Plugin("HeuristicLab.Scripting.Views", "3.3.9.$WCREV$")] 26 [PluginFile("HeuristicLab.Scripting.Views-3.3.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.CodeEditor", "3.3")] 28 28 [PluginDependency("HeuristicLab.Collections", "3.3")] … … 31 31 [PluginDependency("HeuristicLab.Core", "3.3")] 32 32 [PluginDependency("HeuristicLab.Core.Views", "3.3")] 33 [PluginDependency("HeuristicLab. HLScript", "3.3")]33 [PluginDependency("HeuristicLab.Scripting", "3.3")] 34 34 [PluginDependency("HeuristicLab.MainForm", "3.3")] 35 35 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 36 36 [PluginDependency("HeuristicLab.Persistence", "3.3")] 37 public class HeuristicLab HLScriptViewsPlugin : PluginBase {37 public class HeuristicLabScriptingViewsPlugin : PluginBase { 38 38 } 39 39 } -
trunk/sources/HeuristicLab.HLScript.Views/3.3/Properties/AssemblyInfo.cs.frame
r10332 r10506 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 27 27 // set of attributes. Change these attribute values to modify the information 28 28 // associated with an assembly. 29 [assembly: AssemblyTitle("HeuristicLab. HLScript.Views")]29 [assembly: AssemblyTitle("HeuristicLab.Scripting.Views")] 30 30 [assembly: AssemblyDescription("")] 31 31 [assembly: AssemblyConfiguration("")] 32 32 [assembly: AssemblyCompany("")] 33 33 [assembly: AssemblyProduct("HeuristicLab")] 34 [assembly: AssemblyCopyright("(c) 2002-201 3HEAL")]34 [assembly: AssemblyCopyright("(c) 2002-2014 HEAL")] 35 35 [assembly: AssemblyTrademark("")] 36 36 [assembly: AssemblyCulture("")] -
trunk/sources/HeuristicLab.HLScript.Views/3.3/ScriptView.Designer.cs
r10401 r10506 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 namespace HeuristicLab. HLScript.Views {22 namespace HeuristicLab.Scripting.Views { 23 23 partial class ScriptView { 24 24 /// <summary> … … 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 47 48 this.compilationLabel = new System.Windows.Forms.Label(); 48 49 this.startStopButton = new System.Windows.Forms.Button(); 49 50 this.errorListView = new System.Windows.Forms.ListView(); 51 this.iconColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 50 52 this.categoryColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 51 53 this.errorNumberColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); … … 53 55 this.columnColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 54 56 this.descriptionColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 57 this.imageList = new System.Windows.Forms.ImageList(this.components); 55 58 this.codeEditor = new HeuristicLab.CodeEditor.CodeEditor(); 56 59 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 57 60 this.splitContainer2 = new System.Windows.Forms.SplitContainer(); 58 this.tabControl1 = new System.Windows.Forms.TabControl(); 59 this.errorListTabPage = new System.Windows.Forms.TabPage(); 61 this.infoTabControl = new System.Windows.Forms.TabControl(); 60 62 this.outputTabPage = new System.Windows.Forms.TabPage(); 61 63 this.outputTextBox = new System.Windows.Forms.TextBox(); 62 this.variableStoreView = new HeuristicLab.HLScript.Views.VariableStoreView(); 64 this.errorListTabPage = new System.Windows.Forms.TabPage(); 65 this.variableStoreView = new HeuristicLab.Scripting.Views.VariableStoreView(); 63 66 this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 67 this.compileButton = new System.Windows.Forms.Button(); 64 68 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 65 69 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); … … 71 75 this.splitContainer2.Panel2.SuspendLayout(); 72 76 this.splitContainer2.SuspendLayout(); 73 this.tabControl1.SuspendLayout(); 77 this.infoTabControl.SuspendLayout(); 78 this.outputTabPage.SuspendLayout(); 74 79 this.errorListTabPage.SuspendLayout(); 75 this.outputTabPage.SuspendLayout();76 80 this.SuspendLayout(); 77 81 // … … 91 95 this.compilationLabel.AutoSize = true; 92 96 this.compilationLabel.ForeColor = System.Drawing.SystemColors.ControlDarkDark; 93 this.compilationLabel.Location = new System.Drawing.Point( 33, 32);97 this.compilationLabel.Location = new System.Drawing.Point(66, 32); 94 98 this.compilationLabel.Name = "compilationLabel"; 95 99 this.compilationLabel.Size = new System.Drawing.Size(69, 13); … … 100 104 // 101 105 this.startStopButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Play; 102 this.startStopButton.Location = new System.Drawing.Point(3 , 26);106 this.startStopButton.Location = new System.Drawing.Point(36, 26); 103 107 this.startStopButton.Name = "startStopButton"; 104 108 this.startStopButton.Size = new System.Drawing.Size(24, 24); … … 112 116 // 113 117 this.errorListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 118 this.iconColumnHeader, 114 119 this.categoryColumnHeader, 115 120 this.errorNumberColumnHeader, … … 124 129 this.errorListView.Name = "errorListView"; 125 130 this.errorListView.Size = new System.Drawing.Size(623, 79); 131 this.errorListView.SmallImageList = this.imageList; 126 132 this.errorListView.TabIndex = 0; 127 133 this.errorListView.UseCompatibleStateImageBehavior = false; 128 134 this.errorListView.View = System.Windows.Forms.View.Details; 129 135 // 136 // iconColumnHeader 137 // 138 this.iconColumnHeader.Text = ""; 139 // 130 140 // categoryColumnHeader 131 141 // … … 135 145 // 136 146 this.errorNumberColumnHeader.Text = "Error Number"; 137 this.errorNumberColumnHeader.Width = 78;138 147 // 139 148 // lineColumnHeader 140 149 // 141 150 this.lineColumnHeader.Text = "Line"; 142 this.lineColumnHeader.Width = 50;143 151 // 144 152 // columnColumnHeader 145 153 // 146 154 this.columnColumnHeader.Text = "Column"; 147 this.columnColumnHeader.Width = 50;148 155 // 149 156 // descriptionColumnHeader 150 157 // 151 158 this.descriptionColumnHeader.Text = "Description"; 152 this.descriptionColumnHeader.Width = 600; 159 // 160 // imageList 161 // 162 this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; 163 this.imageList.ImageSize = new System.Drawing.Size(16, 16); 164 this.imageList.TransparentColor = System.Drawing.Color.Transparent; 153 165 // 154 166 // codeEditor … … 197 209 // splitContainer2.Panel2 198 210 // 199 this.splitContainer2.Panel2.Controls.Add(this. tabControl1);211 this.splitContainer2.Panel2.Controls.Add(this.infoTabControl); 200 212 this.splitContainer2.Size = new System.Drawing.Size(637, 543); 201 213 this.splitContainer2.SplitterDistance = 428; 202 214 this.splitContainer2.TabIndex = 5; 203 215 // 204 // tabControl1 205 // 206 this.tabControl1.Controls.Add(this.errorListTabPage); 207 this.tabControl1.Controls.Add(this.outputTabPage); 208 this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; 209 this.tabControl1.Location = new System.Drawing.Point(0, 0); 210 this.tabControl1.Name = "tabControl1"; 211 this.tabControl1.SelectedIndex = 0; 212 this.tabControl1.Size = new System.Drawing.Size(637, 111); 213 this.tabControl1.TabIndex = 1; 214 // 215 // errorListTabPage 216 // 217 this.errorListTabPage.Controls.Add(this.errorListView); 218 this.errorListTabPage.Location = new System.Drawing.Point(4, 22); 219 this.errorListTabPage.Name = "errorListTabPage"; 220 this.errorListTabPage.Padding = new System.Windows.Forms.Padding(3); 221 this.errorListTabPage.Size = new System.Drawing.Size(629, 85); 222 this.errorListTabPage.TabIndex = 0; 223 this.errorListTabPage.Text = "Error List"; 224 this.errorListTabPage.UseVisualStyleBackColor = true; 216 // infoTabControl 217 // 218 this.infoTabControl.Controls.Add(this.outputTabPage); 219 this.infoTabControl.Controls.Add(this.errorListTabPage); 220 this.infoTabControl.Dock = System.Windows.Forms.DockStyle.Fill; 221 this.infoTabControl.Location = new System.Drawing.Point(0, 0); 222 this.infoTabControl.Name = "infoTabControl"; 223 this.infoTabControl.SelectedIndex = 0; 224 this.infoTabControl.Size = new System.Drawing.Size(637, 111); 225 this.infoTabControl.TabIndex = 1; 225 226 // 226 227 // outputTabPage … … 247 248 this.outputTextBox.TabIndex = 0; 248 249 this.outputTextBox.WordWrap = false; 250 // 251 // errorListTabPage 252 // 253 this.errorListTabPage.Controls.Add(this.errorListView); 254 this.errorListTabPage.Location = new System.Drawing.Point(4, 22); 255 this.errorListTabPage.Name = "errorListTabPage"; 256 this.errorListTabPage.Padding = new System.Windows.Forms.Padding(3); 257 this.errorListTabPage.Size = new System.Drawing.Size(629, 85); 258 this.errorListTabPage.TabIndex = 0; 259 this.errorListTabPage.Text = "Error List"; 260 this.errorListTabPage.UseVisualStyleBackColor = true; 249 261 // 250 262 // variableStoreView … … 273 285 this.viewHost.ViewType = null; 274 286 // 287 // compileButton 288 // 289 this.compileButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Script; 290 this.compileButton.Location = new System.Drawing.Point(6, 26); 291 this.compileButton.Name = "compileButton"; 292 this.compileButton.Size = new System.Drawing.Size(24, 24); 293 this.compileButton.TabIndex = 8; 294 this.compileButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; 295 this.toolTip.SetToolTip(this.compileButton, "Compile (F6)"); 296 this.compileButton.UseVisualStyleBackColor = true; 297 this.compileButton.Click += new System.EventHandler(this.compileButton_Click); 298 // 275 299 // ScriptView 276 300 // 277 301 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 302 this.Controls.Add(this.compileButton); 278 303 this.Controls.Add(this.splitContainer1); 279 304 this.Controls.Add(this.startStopButton); … … 287 312 this.Controls.SetChildIndex(this.nameTextBox, 0); 288 313 this.Controls.SetChildIndex(this.infoLabel, 0); 314 this.Controls.SetChildIndex(this.compileButton, 0); 289 315 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 290 316 this.splitContainer1.Panel1.ResumeLayout(false); … … 296 322 ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); 297 323 this.splitContainer2.ResumeLayout(false); 298 this.tabControl1.ResumeLayout(false); 299 this.errorListTabPage.ResumeLayout(false); 324 this.infoTabControl.ResumeLayout(false); 300 325 this.outputTabPage.ResumeLayout(false); 301 326 this.outputTabPage.PerformLayout(); 327 this.errorListTabPage.ResumeLayout(false); 302 328 this.ResumeLayout(false); 303 329 this.PerformLayout(); … … 320 346 private System.Windows.Forms.ColumnHeader errorNumberColumnHeader; 321 347 private System.Windows.Forms.ColumnHeader categoryColumnHeader; 322 private System.Windows.Forms.TabControl tabControl1;348 private System.Windows.Forms.TabControl infoTabControl; 323 349 private System.Windows.Forms.TabPage errorListTabPage; 324 350 private System.Windows.Forms.TabPage outputTabPage; 325 351 private System.Windows.Forms.TextBox outputTextBox; 352 private System.Windows.Forms.Button compileButton; 353 private System.Windows.Forms.ColumnHeader iconColumnHeader; 354 private System.Windows.Forms.ImageList imageList; 326 355 } 327 356 } -
trunk/sources/HeuristicLab.HLScript.Views/3.3/ScriptView.cs
r10401 r10506 22 22 using System; 23 23 using System.CodeDom.Compiler; 24 using System.Collections.Generic;25 24 using System.Drawing; 25 using System.Globalization; 26 26 using System.Linq; 27 27 using System.Windows.Forms; … … 31 31 using HeuristicLab.MainForm; 32 32 33 namespace HeuristicLab. HLScript.Views {33 namespace HeuristicLab.Scripting.Views { 34 34 35 35 [View("Script View")] … … 45 45 public ScriptView() { 46 46 InitializeComponent(); 47 errorListView.SmallImageList.Images.AddRange(new Image[] { VSImageLibrary.Warning, VSImageLibrary.Error }); 48 AdjustErrorListViewColumnSizes(); 47 49 } 48 50 … … 68 70 } 69 71 private void Content_ScriptExecutionStarted(object sender, EventArgs e) { 70 Locked = true; 71 ReadOnly = true; 72 startStopButton.Image = VSImageLibrary.Stop; 73 } 74 private void Content_ScriptExecutionFinished(object sender, EventArgs e) { 75 Locked = false; 76 ReadOnly = false; 77 startStopButton.Image = VSImageLibrary.Play; 78 running = false; 72 if (InvokeRequired) 73 Invoke((Action<object, EventArgs>)Content_ScriptExecutionStarted, sender, e); 74 else { 75 Locked = true; 76 ReadOnly = true; 77 startStopButton.Image = VSImageLibrary.Stop; 78 infoTabControl.SelectedTab = outputTabPage; 79 } 80 } 81 private void Content_ScriptExecutionFinished(object sender, EventArgs<Exception> e) { 82 if (InvokeRequired) 83 Invoke((Action<object, EventArgs<Exception>>)Content_ScriptExecutionFinished, sender, e); 84 else { 85 Locked = false; 86 ReadOnly = false; 87 startStopButton.Image = VSImageLibrary.Play; 88 running = false; 89 var ex = e.Value; 90 if (ex != null) 91 PluginInfrastructure.ErrorHandling.ShowErrorDialog(this, ex); 92 } 79 93 } 80 94 private void Content_ConsoleOutputChanged(object sender, EventArgs<string> e) { 81 if (InvokeRequired) Invoke((Action<object, EventArgs<string>>)Content_ConsoleOutputChanged, sender, e); 95 if (InvokeRequired) 96 Invoke((Action<object, EventArgs<string>>)Content_ConsoleOutputChanged, sender, e); 82 97 else { 83 98 outputTextBox.AppendText(e.Value); … … 111 126 protected override void SetEnabledStateOfControls() { 112 127 base.SetEnabledStateOfControls(); 128 compileButton.Enabled = Content != null && !Locked && !ReadOnly; 113 129 startStopButton.Enabled = Content != null && (!Locked || running); 114 130 codeEditor.Enabled = Content != null && !Locked && !ReadOnly; … … 116 132 117 133 #region Child Control event handlers 134 private void compileButton_Click(object sender, EventArgs e) { 135 Compile(); 136 } 137 118 138 private void startStopButton_Click(object sender, EventArgs e) { 119 139 if (running) { … … 134 154 #region global HotKeys 135 155 protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { 136 if (keyData == Keys.F5) { 137 if (Content == null || Locked) 138 return base.ProcessCmdKey(ref msg, keyData); 139 outputTextBox.Clear(); 140 bool result = Compile(); 141 if (result) { 142 outputTextBox.Clear(); 143 Content.Execute(); 144 running = true; 145 } 146 return true; 147 } else if (keyData == (Keys.F5 | Keys.Shift)) { 148 Content.Kill(); 156 switch (keyData) { 157 case Keys.F5: 158 if (Content != null && !Locked) { 159 if (Compile()) { 160 outputTextBox.Clear(); 161 Content.Execute(); 162 running = true; 163 } else 164 infoTabControl.SelectedTab = errorListTabPage; 165 } 166 break; 167 case Keys.F5 | Keys.Shift: 168 if (running) Content.Kill(); 169 break; 170 case Keys.F6: 171 if (!Compile() || Content.CompileErrors.HasWarnings) 172 infoTabControl.SelectedTab = errorListTabPage; 173 break; 149 174 } 150 175 return base.ProcessCmdKey(ref msg, keyData); … … 157 182 Locked = true; 158 183 errorListView.Items.Clear(); 159 outputTextBox.Clear(); 160 outputTextBox.AppendText("Compiling ... "); 184 outputTextBox.Text = "Compiling ... "; 161 185 try { 162 186 Content.Compile(); … … 165 189 } catch { 166 190 outputTextBox.AppendText("Compilation failed."); 167 ShowCompilationErrors();168 191 return false; 169 192 } finally { 170 OnContentChanged();193 ShowCompilationResults(); 171 194 ReadOnly = false; 172 195 Locked = false; 173 } 174 } 175 #endregion 176 177 private void ShowCompilationErrors() { 196 OnContentChanged(); 197 } 198 } 199 #endregion 200 201 private void ShowCompilationResults() { 178 202 if (Content.CompileErrors.Count == 0) return; 179 var warnings = new List<CompilerError>(); 180 var errors = new List<CompilerError>(); 181 foreach (CompilerError ce in Content.CompileErrors) { 182 if (ce.IsWarning) warnings.Add(ce); 183 else errors.Add(ce); 184 } 185 var msgs = warnings.OrderBy(x => x.Line) 186 .ThenBy(x => x.Column) 187 .Concat(errors.OrderBy(x => x.Line) 188 .ThenBy(x => x.Column)); 189 outputTextBox.AppendText(Environment.NewLine); 190 outputTextBox.AppendText("---"); 191 outputTextBox.AppendText(Environment.NewLine); 203 var msgs = Content.CompileErrors.OfType<CompilerError>() 204 .OrderBy(x => x.IsWarning) 205 .ThenBy(x => x.Line) 206 .ThenBy(x => x.Column); 192 207 foreach (var m in msgs) { 193 var item = new ListViewItem(new[] { 208 var item = new ListViewItem(); 209 item.SubItems.AddRange(new[] { 194 210 m.IsWarning ? "Warning" : "Error", 195 211 m.ErrorNumber, 196 m.Line.ToString( ),197 m.Column.ToString( ),212 m.Line.ToString(CultureInfo.InvariantCulture), 213 m.Column.ToString(CultureInfo.InvariantCulture), 198 214 m.ErrorText 199 215 }); 216 item.ImageIndex = m.IsWarning ? 0 : 1; 200 217 errorListView.Items.Add(item); 201 outputTextBox.AppendText(string.Format("{0} {1} ({2}:{3}): {4}", 202 item.SubItems[0].Text, 203 item.SubItems[1].Text, 204 item.SubItems[2].Text, 205 item.SubItems[3].Text, 206 item.SubItems[4].Text)); 207 outputTextBox.AppendText(Environment.NewLine); 208 } 218 } 219 AdjustErrorListViewColumnSizes(); 220 } 221 222 private void AdjustErrorListViewColumnSizes() { 223 foreach (ColumnHeader ch in errorListView.Columns) 224 // adjusts the column width to the width of the column 225 // header or the column content, whichever is greater 226 ch.Width = -2; 209 227 } 210 228 } -
trunk/sources/HeuristicLab.HLScript.Views/3.3/VariableStoreView.Designer.cs
r10358 r10506 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using System.Windows.Forms; 23 23 24 namespace HeuristicLab. HLScript.Views {24 namespace HeuristicLab.Scripting.Views { 25 25 partial class VariableStoreView { 26 26 /// <summary> -
trunk/sources/HeuristicLab.HLScript.Views/3.3/VariableStoreView.cs
r10401 r10506 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using System.Drawing; 26 26 using System.Linq; 27 using System.Text.RegularExpressions; 27 28 using System.Windows.Forms; 28 29 using HeuristicLab.Collections; … … 36 37 using HeuristicLab.PluginInfrastructure; 37 38 38 namespace HeuristicLab. HLScript.Views {39 namespace HeuristicLab.Scripting.Views { 39 40 [View("ItemCollection View")] 40 41 [Content(typeof(VariableStore), true)] … … 288 289 } 289 290 291 private readonly Regex SafeVariableNameRegex = new Regex("^[@]?[_a-zA-Z][_a-zA-Z0-9]*$"); 290 292 private void variableListView_AfterLabelEdit(object sender, LabelEditEventArgs e) { 291 if (!string.IsNullOrEmpty(e.Label)) { 293 string name = e.Label; 294 if (!string.IsNullOrEmpty(name) && SafeVariableNameRegex.IsMatch(name)) { 292 295 var variable = (KeyValuePair<string, object>)variableListView.Items[e.Item].Tag; 293 if (!Content.ContainsKey( e.Label)) {296 if (!Content.ContainsKey(name)) { 294 297 Content.Remove(variable.Key); 295 Content.Add( e.Label, variable.Value);298 Content.Add(name, variable.Value); 296 299 } 297 300 } … … 390 393 } 391 394 protected virtual void AdjustListViewColumnSizes() { 392 if (variableListView.Items.Count > 0) { 393 for (int i = 0; i < variableListView.Columns.Count; i++) 394 variableListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 395 } 395 foreach (ColumnHeader ch in variableListView.Columns) 396 ch.Width = -2; 396 397 } 397 398 protected virtual void RebuildImageList() { -
trunk/sources/HeuristicLab.HLScript/3.3/HeuristicLab.Scripting-3.3.csproj
r10501 r10506 8 8 <OutputType>Library</OutputType> 9 9 <AppDesignerFolder>Properties</AppDesignerFolder> 10 <RootNamespace>HeuristicLab. HLScript</RootNamespace>11 <AssemblyName>HeuristicLab. HLScript-3.3</AssemblyName>10 <RootNamespace>HeuristicLab.Scripting</RootNamespace> 11 <AssemblyName>HeuristicLab.Scripting-3.3</AssemblyName> 12 12 <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 13 13 <FileAlignment>512</FileAlignment> -
trunk/sources/HeuristicLab.HLScript/3.3/Plugin.cs.frame
r10332 r10506 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using HeuristicLab.PluginInfrastructure; 23 23 24 namespace HeuristicLab. HLScript{25 [Plugin("HeuristicLab. HLScript", "3.3.9.$WCREV$")]26 [PluginFile("HeuristicLab. HLScript-3.3.dll", PluginFileType.Assembly)]24 namespace HeuristicLab.Scripting { 25 [Plugin("HeuristicLab.Scripting", "3.3.9.$WCREV$")] 26 [PluginFile("HeuristicLab.Scripting-3.3.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.Collections", "3.3")] 28 28 [PluginDependency("HeuristicLab.Common", "3.3")] … … 30 30 [PluginDependency("HeuristicLab.Core", "3.3")] 31 31 [PluginDependency("HeuristicLab.Persistence", "3.3")] 32 public class HeuristicLab HLScriptPlugin : PluginBase {32 public class HeuristicLabScriptingPlugin : PluginBase { 33 33 } 34 34 } -
trunk/sources/HeuristicLab.HLScript/3.3/Properties/AssemblyInfo.cs.frame
r10332 r10506 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 27 27 // set of attributes. Change these attribute values to modify the information 28 28 // associated with an assembly. 29 [assembly: AssemblyTitle("HeuristicLab. HLScript")]29 [assembly: AssemblyTitle("HeuristicLab.Scripting")] 30 30 [assembly: AssemblyDescription("")] 31 31 [assembly: AssemblyConfiguration("")] 32 32 [assembly: AssemblyCompany("")] 33 33 [assembly: AssemblyProduct("HeuristicLab")] 34 [assembly: AssemblyCopyright("(c) 2002-201 3HEAL")]34 [assembly: AssemblyCopyright("(c) 2002-2014 HEAL")] 35 35 [assembly: AssemblyTrademark("")] 36 36 [assembly: AssemblyCulture("")] -
trunk/sources/HeuristicLab.HLScript/3.3/Script.cs
r10401 r10506 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.CodeDom; 3 24 using System.CodeDom.Compiler; … … 16 37 using Microsoft.CSharp; 17 38 18 namespace HeuristicLab. HLScript{19 [Item("Script", "A HeuristicLabscript.")]39 namespace HeuristicLab.Scripting { 40 [Item("Script", "An empty C# script.")] 20 41 [Creatable("Scripts")] 21 42 [StorableClass] … … 27 48 28 49 using System; 29 30 namespace UserScripts { 31 public class UserScript : HeuristicLab.HLScript.UserScriptBase { 32 public override void Main() { 33 // type your code here 34 } 35 36 // further classes and methods37 50 using System.Linq; 51 using System.Collections.Generic; 52 using HeuristicLab.Common; 53 using HeuristicLab.Core; 54 using HeuristicLab.Data; 55 56 public class UserScript : HeuristicLab.Scripting.UserScriptBase { 57 public override void Main() { 58 // type your code here 38 59 } 60 61 // further classes and methods 62 39 63 }"; 40 64 #endregion … … 126 150 GenerateExecutable = false, 127 151 GenerateInMemory = true, 128 IncludeDebugInformation = false 152 IncludeDebugInformation = true, 153 WarningLevel = 4 129 154 }; 130 155 parameters.ReferencedAssemblies.AddRange( … … 212 237 if (executeMethod != null) { 213 238 scriptThread = new Thread(() => { 239 Exception ex = null; 214 240 try { 215 241 OnScriptExecutionStarted(); 216 242 executeMethod.Invoke(compiledScript, new[] { VariableStore }); 243 } catch (ThreadAbortException) { 244 // the execution was cancelled by the user 245 } catch (TargetInvocationException e) { 246 ex = e.InnerException; 217 247 } finally { 218 OnScriptExecutionFinished( );248 OnScriptExecutionFinished(ex); 219 249 } 220 250 }); … … 250 280 } 251 281 252 public event EventHandler ScriptExecutionFinished;253 private void OnScriptExecutionFinished( ) {282 public event EventHandler<EventArgs<Exception>> ScriptExecutionFinished; 283 private void OnScriptExecutionFinished(Exception e) { 254 284 var handler = ScriptExecutionFinished; 255 if (handler != null) handler(this, EventArgs.Empty);285 if (handler != null) handler(this, new EventArgs<Exception>(e)); 256 286 } 257 287 -
trunk/sources/HeuristicLab.HLScript/3.3/UserScriptBase.cs
r10401 r10506 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Dynamic; 3 24 using System.IO; 4 25 using System.Text; 5 using System.Threading;6 26 using HeuristicLab.Common; 7 27 8 namespace HeuristicLab. HLScript{28 namespace HeuristicLab.Scripting { 9 29 public abstract class UserScriptBase { 10 30 protected dynamic vars; … … 23 43 private void Execute(VariableStore variableStore) { 24 44 vars = new Variables(variableStore); 25 try { 26 Main(); 27 } catch (ThreadAbortException) { 28 } catch (Exception e) { 29 Console.WriteLine("---"); 30 Console.WriteLine(e); 31 } 45 Main(); 32 46 } 33 47 -
trunk/sources/HeuristicLab.HLScript/3.3/VariableStore.cs
r10332 r10506 1 using HeuristicLab.Collections; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Collections; 2 23 using HeuristicLab.Common; 3 24 using HeuristicLab.Core; 4 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 5 26 6 namespace HeuristicLab. HLScript{27 namespace HeuristicLab.Scripting { 7 28 [Item("VariableStore", "Represents a variable store.")] 8 29 [StorableClass]
Note: See TracChangeset
for help on using the changeset viewer.