- Timestamp:
- 02/18/15 10:54:32 (9 years ago)
- Location:
- branches/HeuristicLab.DatasetRefactor/sources
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DatasetRefactor/sources
- Property svn:mergeinfo changed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting.Views/3.3/CSharpScriptView.Designer.cs
r10731 r12031 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. -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting.Views/3.3/CSharpScriptView.cs
r11171 r12031 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; 24 using System.Threading; 23 25 using System.Windows.Forms; 24 26 using HeuristicLab.Common; … … 31 33 [Content(typeof(CSharpScript), true)] 32 34 public partial class CSharpScriptView : ScriptView { 35 private const string ScriptExecutionStartedMessage = "Script execution started"; 36 private const string ScriptExecutionCanceledMessage = "Script execution canceled"; 37 private const string ScriptExecutionSuccessfulMessage = "Script execution successful"; 38 private const string ScriptExecutionFailedMessage = "Script execution failed"; 39 33 40 protected bool Running { get; set; } 34 41 … … 65 72 startStopButton.Image = VSImageLibrary.Stop; 66 73 toolTip.SetToolTip(startStopButton, "Stop (Shift+F5)"); 74 UpdateInfoTextLabel(ScriptExecutionStartedMessage, SystemColors.ControlText); 67 75 infoTabControl.SelectedTab = outputTabPage; 68 76 } … … 76 84 startStopButton.Image = VSImageLibrary.Play; 77 85 toolTip.SetToolTip(startStopButton, "Run (F5)"); 86 87 var ex = e.Value; 88 if (ex == null) { 89 UpdateInfoTextLabel(ScriptExecutionSuccessfulMessage, Color.DarkGreen); 90 } else if (ex is ThreadAbortException) { 91 // the execution was canceled by the user 92 UpdateInfoTextLabel(ScriptExecutionCanceledMessage, Color.DarkOrange); 93 } else { 94 UpdateInfoTextLabel(ScriptExecutionFailedMessage, Color.DarkRed); 95 PluginInfrastructure.ErrorHandling.ShowErrorDialog(this, ex); 96 } 97 78 98 Running = false; 79 var ex = e.Value;80 if (ex != null)81 PluginInfrastructure.ErrorHandling.ShowErrorDialog(this, ex);82 99 } 83 100 } … … 111 128 if (Compile()) { 112 129 outputTextBox.Clear(); 113 Content.Execute();114 130 Running = true; 131 Content.ExecuteAsync(); 115 132 } 116 133 } … … 123 140 if (Compile()) { 124 141 outputTextBox.Clear(); 125 Content.Execute ();142 Content.ExecuteAsync(); 126 143 Running = true; 127 144 } … … 132 149 return true; 133 150 case Keys.F6: 134 if (!Running) Compile();151 if (!Running) base.ProcessCmdKey(ref msg, keyData); 135 152 return true; 136 153 } 137 return base.ProcessCmdKey(ref msg, keyData); ;154 return base.ProcessCmdKey(ref msg, keyData); 138 155 } 139 156 #endregion -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting.Views/3.3/HeuristicLab.Scripting.Views-3.3.csproj
r11078 r12031 10 10 <RootNamespace>HeuristicLab.Scripting.Views</RootNamespace> 11 11 <AssemblyName>HeuristicLab.Scripting.Views-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> … … 112 118 </ItemGroup> 113 119 <ItemGroup> 114 <ProjectReference Include="..\..\HeuristicLab.CodeEditor\3.3\HeuristicLab.CodeEditor-3.3.csproj"> 115 <Project>{489cfe09-fdf7-4c89-bab5-bd09cadd61ad}</Project> 116 <Name>HeuristicLab.CodeEditor-3.3</Name> 117 <Private>False</Private> 120 <ProjectReference Include="..\..\HeuristicLab.CodeEditor\3.4\HeuristicLab.CodeEditor-3.4.csproj"> 121 <Project>{c38691ae-ecb4-489a-a05d-b035554e0168}</Project> 122 <Name>HeuristicLab.CodeEditor-3.4</Name> 118 123 </ProjectReference> 119 124 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> … … 169 174 </ItemGroup> 170 175 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 171 176 <PropertyGroup> 172 177 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 173 178 set ProjectDir=$(ProjectDir) -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting.Views/3.3/Plugin.cs.frame
r11174 r12031 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.Views { 25 [Plugin("HeuristicLab.Scripting.Views", "3.3.1 0.$WCREV$")]25 [Plugin("HeuristicLab.Scripting.Views", "3.3.11.$WCREV$")] 26 26 [PluginFile("HeuristicLab.Scripting.Views-3.3.dll", PluginFileType.Assembly)] 27 [PluginDependency("HeuristicLab.CodeEditor", "3. 3")]27 [PluginDependency("HeuristicLab.CodeEditor", "3.4")] 28 28 [PluginDependency("HeuristicLab.Collections", "3.3")] 29 29 [PluginDependency("HeuristicLab.Common", "3.3")] -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting.Views/3.3/Properties/AssemblyInfo.cs.frame
r11174 r12031 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$")] -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting.Views/3.3/ScriptView.Designer.cs
r10747 r12031 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. … … 19 19 */ 20 20 #endregion 21 22 using System.Collections.Generic; 23 using System.Reflection; 24 using HeuristicLab.Common; 21 25 22 26 namespace HeuristicLab.Scripting.Views { … … 46 50 private void InitializeComponent() { 47 51 this.components = new System.ComponentModel.Container(); 48 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ScriptView)); 49 this.compilationLabel = new System.Windows.Forms.Label(); 52 this.infoTextLabel = new System.Windows.Forms.Label(); 50 53 this.imageList = new System.Windows.Forms.ImageList(this.components); 51 54 this.compileButton = new System.Windows.Forms.Button(); … … 84 87 this.infoLabel.Location = new System.Drawing.Point(816, 4); 85 88 // 86 // compilationLabel87 // 88 this. compilationLabel.AutoSize = true;89 this. compilationLabel.ForeColor = System.Drawing.SystemColors.ControlDarkDark;90 this. compilationLabel.Location = new System.Drawing.Point(66, 32);91 this. compilationLabel.Name = "compilationLabel";92 this. compilationLabel.Size = new System.Drawing.Size(69, 13);93 this. compilationLabel.TabIndex = 3;94 this. compilationLabel.Text = "Not compiled";89 // infoTextLabel 90 // 91 this.infoTextLabel.AutoSize = true; 92 this.infoTextLabel.ForeColor = System.Drawing.SystemColors.ControlDarkDark; 93 this.infoTextLabel.Location = new System.Drawing.Point(66, 32); 94 this.infoTextLabel.Name = "infoTextLabel"; 95 this.infoTextLabel.Size = new System.Drawing.Size(69, 13); 96 this.infoTextLabel.TabIndex = 3; 97 this.infoTextLabel.Text = "Not compiled"; 95 98 // 96 99 // imageList … … 110 113 this.toolTip.SetToolTip(this.compileButton, "Compile (F6)"); 111 114 this.compileButton.UseVisualStyleBackColor = true; 112 this.compileButton.Click += new System.EventHandler(this. CompileButtonOnClick);115 this.compileButton.Click += new System.EventHandler(this.compileButton_Click); 113 116 // 114 117 // infoTabControl … … 178 181 this.errorListView.UseCompatibleStateImageBehavior = false; 179 182 this.errorListView.View = System.Windows.Forms.View.Details; 183 this.errorListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.errorListView_MouseDoubleClick); 180 184 // 181 185 // iconColumnHeader … … 213 217 this.codeEditor.TabIndex = 0; 214 218 this.codeEditor.UserCode = ""; 215 this.codeEditor.TextEditorTextChanged += new System.EventHandler(this.CodeEditorOnTextEditorTextChanged); 219 this.codeEditor.TextEditorTextChanged += new System.EventHandler(this.codeEditor_TextEditorTextChanged); 220 this.codeEditor.AssembliesLoading += new System.EventHandler<HeuristicLab.Common.EventArgs<System.Collections.Generic.IEnumerable<System.Reflection.Assembly>>>(this.codeEditor_AssembliesLoading); 221 this.codeEditor.AssembliesLoaded += new System.EventHandler<HeuristicLab.Common.EventArgs<System.Collections.Generic.IEnumerable<System.Reflection.Assembly>>>(this.codeEditor_AssembliesLoaded); 222 this.codeEditor.AssembliesUnloading += new System.EventHandler<HeuristicLab.Common.EventArgs<System.Collections.Generic.IEnumerable<System.Reflection.Assembly>>>(this.codeEditor_AssembliesUnloading); 223 this.codeEditor.AssembliesUnloaded += new System.EventHandler<HeuristicLab.Common.EventArgs<System.Collections.Generic.IEnumerable<System.Reflection.Assembly>>>(this.codeEditor_AssembliesUnloaded); 216 224 // 217 225 // splitContainer1 218 226 // 219 this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 220 | System.Windows.Forms.AnchorStyles.Left) 227 this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 228 | System.Windows.Forms.AnchorStyles.Left) 221 229 | System.Windows.Forms.AnchorStyles.Right))); 222 230 this.splitContainer1.Location = new System.Drawing.Point(0, 56); … … 240 248 this.Controls.Add(this.splitContainer1); 241 249 this.Controls.Add(this.compileButton); 242 this.Controls.Add(this. compilationLabel);250 this.Controls.Add(this.infoTextLabel); 243 251 this.Name = "ScriptView"; 244 252 this.Size = new System.Drawing.Size(835, 602); 245 this.Controls.SetChildIndex(this. compilationLabel, 0);253 this.Controls.SetChildIndex(this.infoTextLabel, 0); 246 254 this.Controls.SetChildIndex(this.compileButton, 0); 247 255 this.Controls.SetChildIndex(this.splitContainer1, 0); … … 265 273 #endregion 266 274 267 protected System.Windows.Forms.Label compilationLabel;275 protected System.Windows.Forms.Label infoTextLabel; 268 276 protected System.Windows.Forms.Button compileButton; 269 277 protected System.Windows.Forms.ImageList imageList; -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting.Views/3.3/ScriptView.cs
r11480 r12031 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. … … 22 22 using System; 23 23 using System.CodeDom.Compiler; 24 using System.Collections.Generic; 24 25 using System.Drawing; 25 26 using System.Globalization; 26 27 using System.Linq; 28 using System.Reflection; 27 29 using System.Windows.Forms; 30 using HeuristicLab.Common; 28 31 using HeuristicLab.Common.Resources; 29 32 using HeuristicLab.Core.Views; … … 35 38 [Content(typeof(Script), true)] 36 39 public partial class ScriptView : NamedItemView { 40 private const string NotCompiledMessage = "Not compiled"; 41 private const string CompilationSucceededMessage = "Compilation succeeded"; 42 private const string CompilationFailedMessage = "Compilation failed"; 43 private const string AssembliesLoadingMessage = "Loading Assemblies"; 44 private const string AssembliesUnloadingMessage = "Unloading Assemblies"; 45 private const int SilentAssemblyLoadingOperationLimit = 10; 46 47 #region Properties 37 48 public new Script Content { 38 49 get { return (Script)base.Content; } … … 40 51 } 41 52 53 public override bool ReadOnly { 54 get { return codeEditor.ReadOnly || base.ReadOnly; } 55 set { base.ReadOnly = codeEditor.ReadOnly = value; } 56 } 57 58 public override bool Locked { 59 get { return codeEditor.ReadOnly || base.Locked; } 60 set { base.Locked = codeEditor.ReadOnly = value; } 61 } 62 #endregion 63 42 64 public ScriptView() { 43 65 InitializeComponent(); … … 45 67 } 46 68 47 public override bool ReadOnly {48 get { return codeEditor.ReadOnly || base.ReadOnly; }49 set { base.ReadOnly = codeEditor.ReadOnly = value; }50 }51 52 public override bool Locked {53 get { return codeEditor.ReadOnly || base.Locked; }54 set { base.Locked = codeEditor.ReadOnly = value; }55 }56 57 69 protected override void RegisterContentEvents() { 58 70 base.RegisterContentEvents(); 59 Content.CodeChanged += Content OnCodeChanged;71 Content.CodeChanged += Content_CodeChanged; 60 72 } 61 73 62 74 protected override void DeregisterContentEvents() { 63 Content.CodeChanged -= Content OnCodeChanged;75 Content.CodeChanged -= Content_CodeChanged; 64 76 base.DeregisterContentEvents(); 65 77 } 66 78 67 protected virtual void ContentOnCodeChanged(object sender, EventArgs e) { 68 codeEditor.UserCode = Content.Code; 69 } 70 79 #region Overrides 71 80 protected override void OnContentChanged() { 72 81 base.OnContentChanged(); … … 75 84 } else { 76 85 codeEditor.UserCode = Content.Code; 77 foreach (var asm in Content.GetAssemblies()) 78 codeEditor.AddAssembly(asm); 86 codeEditor.AddAssembliesAsync(Content.GetAssemblies()); 79 87 if (Content.CompileErrors == null) { 80 compilationLabel.ForeColor = SystemColors.ControlDarkDark; 81 compilationLabel.Text = "Not compiled"; 82 } else if (Content.CompileErrors.HasErrors) { 83 compilationLabel.ForeColor = Color.DarkRed; 84 compilationLabel.Text = "Compilation failed"; 85 } else { 86 compilationLabel.ForeColor = Color.DarkGreen; 87 compilationLabel.Text = "Compilation successful"; 88 UpdateInfoTextLabel(NotCompiledMessage, SystemColors.ControlText); 88 89 } 89 90 } … … 96 97 } 97 98 98 protected virtual void CompileButtonOnClick(object sender, EventArgs e) {99 Compile();100 }101 102 protected virtual void CodeEditorOnTextEditorTextChanged(object sender, EventArgs e) {103 if (Content == null) return;104 Content.Code = codeEditor.UserCode;105 }106 99 protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { 107 100 switch (keyData) { … … 113 106 return base.ProcessCmdKey(ref msg, keyData); 114 107 } 108 #endregion 115 109 116 110 public virtual bool Compile() { … … 121 115 try { 122 116 Content.Compile(); 123 outputTextBox.AppendText("Compilation succeeded."); 117 outputTextBox.AppendText(CompilationSucceededMessage); 118 UpdateInfoTextLabel(CompilationSucceededMessage, Color.DarkGreen); 124 119 return true; 125 } catch {120 } catch (CompilationException) { 126 121 if (Content.CompileErrors.HasErrors) { 127 outputTextBox.AppendText("Compilation failed."); 122 outputTextBox.AppendText(CompilationFailedMessage); 123 UpdateInfoTextLabel(CompilationFailedMessage, Color.DarkRed); 128 124 return false; 129 125 } else { 130 outputTextBox.AppendText("Compilation succeeded."); 126 outputTextBox.AppendText(CompilationSucceededMessage); 127 UpdateInfoTextLabel(CompilationSucceededMessage, Color.DarkGreen); 131 128 return true; 132 129 } … … 137 134 ReadOnly = false; 138 135 Locked = false; 139 OnContentChanged(); 140 } 141 } 142 136 codeEditor.Focus(); 137 } 138 } 139 140 #region Helpers 143 141 protected virtual void ShowCompilationResults() { 144 if (Content.CompileErrors.Count == 0) return; 145 var msgs = Content.CompileErrors.OfType<CompilerError>() 142 var messages = Content.CompileErrors.OfType<CompilerError>() 146 143 .OrderBy(x => x.IsWarning) 147 144 .ThenBy(x => x.Line) 148 145 .ThenBy(x => x.Column); 149 foreach (var m in msgs) { 150 var item = new ListViewItem(); 146 147 foreach (var m in messages) { 148 var item = new ListViewItem { Tag = m }; 151 149 item.SubItems.AddRange(new[] { 152 150 m.IsWarning ? "Warning" : "Error", … … 159 157 errorListView.Items.Add(item); 160 158 } 159 160 codeEditor.ShowCompileErrors(Content.CompileErrors); 161 161 162 AdjustErrorListViewColumnSizes(); 163 } 164 165 protected virtual void UpdateInfoTextLabel(string message, Color color) { 166 infoTextLabel.Text = message; 167 infoTextLabel.ForeColor = color; 162 168 } 163 169 … … 167 173 ch.Width = -2; 168 174 } 175 176 #region ProgressView 177 private bool progressViewCreated; 178 179 private void AddProgressView(string progressMessage) { 180 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 181 mainForm.AddOperationProgressToView(this, progressMessage); 182 progressViewCreated = true; 183 } 184 185 private void RemoveProgressView() { 186 if (!progressViewCreated) return; 187 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 188 mainForm.RemoveOperationProgressFromView(this); 189 progressViewCreated = false; 190 } 191 #endregion 192 #endregion 193 194 #region Event Handlers 195 protected virtual void Content_CodeChanged(object sender, EventArgs e) { 196 if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_CodeChanged, sender, e); 197 else { 198 codeEditor.UserCode = Content.Code; 199 } 200 } 201 202 private void compileButton_Click(object sender, EventArgs e) { 203 Compile(); 204 } 205 206 private void codeEditor_TextEditorTextChanged(object sender, EventArgs e) { 207 if (Content == null) return; 208 Content.Code = codeEditor.UserCode; 209 } 210 211 private void errorListView_MouseDoubleClick(object sender, MouseEventArgs e) { 212 if (e.Button == MouseButtons.Left) { 213 var item = errorListView.SelectedItems[0]; 214 var message = (CompilerError)item.Tag; 215 codeEditor.ScrollToPosition(message.Line, message.Column); 216 codeEditor.Focus(); 217 } 218 } 219 #endregion 220 221 private void codeEditor_AssembliesLoading(object sender, EventArgs<IEnumerable<Assembly>> e) { 222 if (InvokeRequired) Invoke((Action<object, EventArgs<IEnumerable<Assembly>>>)codeEditor_AssembliesLoading, sender, e); 223 else { 224 int nrOfAssemblies = e.Value.Count(); 225 if (nrOfAssemblies > SilentAssemblyLoadingOperationLimit) 226 AddProgressView(AssembliesLoadingMessage); 227 } 228 } 229 230 private void codeEditor_AssembliesLoaded(object sender, EventArgs<IEnumerable<Assembly>> e) { 231 if (InvokeRequired) Invoke((Action<object, EventArgs<IEnumerable<Assembly>>>)codeEditor_AssembliesLoaded, sender, e); 232 else { 233 RemoveProgressView(); 234 } 235 } 236 237 private void codeEditor_AssembliesUnloading(object sender, EventArgs<IEnumerable<Assembly>> e) { 238 if (InvokeRequired) Invoke((Action<object, EventArgs<IEnumerable<Assembly>>>)codeEditor_AssembliesUnloading, sender, e); 239 else { 240 int nrOfAssemblies = e.Value.Count(); 241 if (nrOfAssemblies > SilentAssemblyLoadingOperationLimit) 242 AddProgressView(AssembliesUnloadingMessage); 243 } 244 } 245 246 private void codeEditor_AssembliesUnloaded(object sender, EventArgs<IEnumerable<Assembly>> e) { 247 if (InvokeRequired) Invoke((Action<object, EventArgs<IEnumerable<Assembly>>>)codeEditor_AssembliesUnloaded, sender, e); 248 else { 249 RemoveProgressView(); 250 } 251 } 169 252 } 170 253 } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting.Views/3.3/VariableStoreView.Designer.cs
r11436 r12031 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. -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Scripting.Views/3.3/VariableStoreView.cs
r11480 r12031 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. … … 47 47 #endregion 48 48 49 private readonly Regex SafeVariableNameRegex = new Regex("^[@]?[_a-zA-Z][_a-zA-Z0-9]*$"); 50 private const string DefaultVariableName = "enter_name"; 49 51 protected readonly Dictionary<string, ListViewItem> itemListViewItemMapping; 50 52 protected readonly Dictionary<Type, bool> serializableLookup; … … 117 119 sortDescendingButton.Enabled = false; 118 120 removeButton.Enabled = false; 119 variableListView. Enabled= false;121 variableListView.LabelEdit = false; 120 122 } else { 121 123 bool enabled = !Locked && !ReadOnly; … … 124 126 sortDescendingButton.Enabled = variableListView.Items.Count > 1; 125 127 removeButton.Enabled = enabled && variableListView.SelectedItems.Count > 0; 126 variableListView.Enabled = enabled;127 128 variableListView.LabelEdit = enabled; 128 129 } … … 242 243 } 243 244 protected virtual void variableListView_DragEnter(object sender, DragEventArgs e) { 244 validDragOperation = !Locked && !ReadOnly && e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) != null; 245 validDragOperation = !Locked && !ReadOnly; 246 247 object item = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat); 248 if (item is KeyValuePair<string, object>) { 249 var variable = (KeyValuePair<string, object>)item; 250 validDragOperation &= variable.Value is IDeepCloneable; 251 } else { 252 validDragOperation &= item is IDeepCloneable; 253 } 245 254 } 246 255 protected virtual void variableListView_DragOver(object sender, DragEventArgs e) { 247 256 e.Effect = DragDropEffects.None; 248 257 if (validDragOperation) { 249 if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy; 258 if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) 259 e.Effect = DragDropEffects.Copy; 250 260 } 251 261 } … … 270 280 271 281 var cloneable = item as IDeepCloneable; 272 if (cloneable != null) item = cloneable.Clone(); 273 274 Content.Add(variableName, item); 282 if (cloneable == null) return; 283 284 var clonedItem = cloneable.Clone(); 285 Content.Add(variableName, clonedItem); 275 286 276 287 var listViewItem = variableListView.FindItemWithText(variableName); … … 278 289 if (editLabel) listViewItem.BeginEdit(); 279 290 } 280 281 private readonly Regex SafeVariableNameRegex = new Regex("^[@]?[_a-zA-Z][_a-zA-Z0-9]*$");282 private const string DefaultVariableName = "enter_name";283 291 284 292 private void variableListView_AfterLabelEdit(object sender, LabelEditEventArgs e) {
Note: See TracChangeset
for help on using the changeset viewer.