Changeset 10891 for stable/HeuristicLab.HLScript.Views/3.3
- Timestamp:
- 05/26/14 16:38:08 (11 years ago)
- Location:
- stable
- Files:
-
- 3 deleted
- 7 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/branches/HLScript (added) merged: 10331-10332,10358 /trunk/sources merged: 10359,10391,10401,10506
- Property svn:mergeinfo changed
-
stable/HeuristicLab.HLScript.Views/3.3
-
Property
svn:global-ignores
set to
bin
obj
Plugin.cs
-
Property
svn:global-ignores
set to
-
stable/HeuristicLab.HLScript.Views/3.3/Plugin.cs.frame
r10358 r10891 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 } -
stable/HeuristicLab.HLScript.Views/3.3/Properties
-
Property
svn:global-ignores
set to
AssemblyInfo.cs
-
Property
svn:global-ignores
set to
-
stable/HeuristicLab.HLScript.Views/3.3/Properties/AssemblyInfo.cs.frame
r10332 r10891 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("")] -
stable/HeuristicLab.HLScript.Views/3.3/ScriptView.Designer.cs
r10401 r10891 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 } -
stable/HeuristicLab.HLScript.Views/3.3/ScriptView.cs
r10401 r10891 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 } -
stable/HeuristicLab.HLScript.Views/3.3/VariableStoreView.Designer.cs
r10358 r10891 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> -
stable/HeuristicLab.HLScript.Views/3.3/VariableStoreView.cs
r10358 r10891 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)] … … 114 115 removeButton.Enabled = !Locked && !ReadOnly && variableListView.SelectedItems.Count > 0; 115 116 variableListView.Enabled = true; 117 variableListView.LabelEdit = !Locked && !ReadOnly; 116 118 } 117 119 } … … 287 289 } 288 290 291 private readonly Regex SafeVariableNameRegex = new Regex("^[@]?[_a-zA-Z][_a-zA-Z0-9]*$"); 289 292 private void variableListView_AfterLabelEdit(object sender, LabelEditEventArgs e) { 290 if (!string.IsNullOrEmpty(e.Label)) { 293 string name = e.Label; 294 if (!string.IsNullOrEmpty(name) && SafeVariableNameRegex.IsMatch(name)) { 291 295 var variable = (KeyValuePair<string, object>)variableListView.Items[e.Item].Tag; 292 if (!Content.ContainsKey( e.Label)) {296 if (!Content.ContainsKey(name)) { 293 297 Content.Remove(variable.Key); 294 Content.Add( e.Label, variable.Value);298 Content.Add(name, variable.Value); 295 299 } 296 300 } … … 389 393 } 390 394 protected virtual void AdjustListViewColumnSizes() { 391 if (variableListView.Items.Count > 0) { 392 for (int i = 0; i < variableListView.Columns.Count; i++) 393 variableListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 394 } 395 foreach (ColumnHeader ch in variableListView.Columns) 396 ch.Width = -2; 395 397 } 396 398 protected virtual void RebuildImageList() {
Note: See TracChangeset
for help on using the changeset viewer.