Changeset 11807 for trunk/sources/HeuristicLab.Scripting.Views
- Timestamp:
- 01/21/15 10:12:08 (10 years ago)
- Location:
- trunk/sources
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/CodeEditor (added) merged: 11700-11701,11707,11722,11738,11741,11743,11765,11785,11800,11802,11804-11805
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Scripting.Views/3.3/HeuristicLab.Scripting.Views-3.3.csproj
r11623 r11807 118 118 </ItemGroup> 119 119 <ItemGroup> 120 <ProjectReference Include="..\..\HeuristicLab.CodeEditor\3.3\HeuristicLab.CodeEditor-3.3.csproj"> 121 <Project>{489cfe09-fdf7-4c89-bab5-bd09cadd61ad}</Project> 122 <Name>HeuristicLab.CodeEditor-3.3</Name> 123 <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> 124 123 </ProjectReference> 125 124 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> -
trunk/sources/HeuristicLab.Scripting.Views/3.3/Plugin.cs.frame
r11174 r11807 25 25 [Plugin("HeuristicLab.Scripting.Views", "3.3.10.$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")] -
trunk/sources/HeuristicLab.Scripting.Views/3.3/ScriptView.Designer.cs
r11657 r11807 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 52 this.compilationLabel = new System.Windows.Forms.Label(); 50 53 this.imageList = new System.Windows.Forms.ImageList(this.components); … … 214 217 this.codeEditor.TabIndex = 0; 215 218 this.codeEditor.UserCode = ""; 219 this.codeEditor.AssembliesLoaded += new System.EventHandler<EventArgs<IEnumerable<Assembly>>>(this.codeEditor_AssembliesLoaded); 220 this.codeEditor.AssembliesLoading += new System.EventHandler<EventArgs<IEnumerable<Assembly>>>(this.codeEditor_AssembliesLoading); 221 this.codeEditor.AssembliesUnloaded += new System.EventHandler<EventArgs<IEnumerable<Assembly>>>(this.codeEditor_AssembliesUnloaded); 222 this.codeEditor.AssembliesUnloading += new System.EventHandler<EventArgs<IEnumerable<Assembly>>>(this.codeEditor_AssembliesUnloading); 216 223 this.codeEditor.TextEditorTextChanged += new System.EventHandler(this.codeEditor_TextEditorTextChanged); 217 224 // 218 225 // splitContainer1 219 226 // 220 this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 221 | 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) 222 229 | System.Windows.Forms.AnchorStyles.Right))); 223 230 this.splitContainer1.Location = new System.Drawing.Point(0, 56); -
trunk/sources/HeuristicLab.Scripting.Views/3.3/ScriptView.cs
r11657 r11807 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 AssembliesLoadingMessage = "Loading Assemblies"; 41 private const string AssembliesUnloadingMessage = "Unloading Assemblies"; 42 private const int SilentAssemblyLoadingOperationLimit = 10; 43 37 44 #region Properties 38 45 public new Script Content { … … 73 80 codeEditor.UserCode = string.Empty; 74 81 } else { 75 if (codeEditor.UserCode != Content.Code) 76 codeEditor.UserCode = Content.Code; 77 foreach (var asm in Content.GetAssemblies()) 78 codeEditor.AddAssembly(asm); 82 codeEditor.UserCode = Content.Code; 83 codeEditor.AddAssembliesAsync(Content.GetAssemblies()); 79 84 if (Content.CompileErrors == null) { 80 85 compilationLabel.ForeColor = SystemColors.ControlDarkDark; … … 131 136 Locked = false; 132 137 codeEditor.Focus(); 133 OnContentChanged();134 138 } 135 139 } … … 157 161 } 158 162 159 codeEditor.ShowCompileErrors(Content.CompileErrors , ".cs");163 codeEditor.ShowCompileErrors(Content.CompileErrors); 160 164 161 165 AdjustErrorListViewColumnSizes(); … … 167 171 ch.Width = -2; 168 172 } 173 174 #region ProgressView 175 private bool progressViewCreated; 176 177 private void AddProgressView(string progressMessage) { 178 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 179 mainForm.AddOperationProgressToView(this, progressMessage); 180 progressViewCreated = true; 181 } 182 183 private void RemoveProgressView() { 184 if (!progressViewCreated) return; 185 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 186 mainForm.RemoveOperationProgressFromView(this); 187 progressViewCreated = false; 188 } 189 #endregion 169 190 #endregion 170 191 171 192 #region Event Handlers 172 193 private void Content_CodeChanged(object sender, EventArgs e) { 173 if (InvokeRequired) 174 Invoke(new EventHandler(Content_CodeChanged), sender, e); 194 if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_CodeChanged, sender, e); 175 195 else { 176 196 codeEditor.UserCode = Content.Code; … … 196 216 } 197 217 #endregion 218 219 private void codeEditor_AssembliesLoading(object sender, EventArgs<IEnumerable<Assembly>> e) { 220 if (InvokeRequired) Invoke((Action<object, EventArgs<IEnumerable<Assembly>>>)codeEditor_AssembliesLoading, sender, e); 221 else { 222 int nrOfAssemblies = e.Value.Count(); 223 if (nrOfAssemblies > SilentAssemblyLoadingOperationLimit) 224 AddProgressView(AssembliesLoadingMessage); 225 } 226 } 227 228 private void codeEditor_AssembliesLoaded(object sender, EventArgs<IEnumerable<Assembly>> e) { 229 if (InvokeRequired) Invoke((Action<object, EventArgs<IEnumerable<Assembly>>>)codeEditor_AssembliesLoaded, sender, e); 230 else { 231 RemoveProgressView(); 232 } 233 } 234 235 private void codeEditor_AssembliesUnloading(object sender, EventArgs<IEnumerable<Assembly>> e) { 236 if (InvokeRequired) Invoke((Action<object, EventArgs<IEnumerable<Assembly>>>)codeEditor_AssembliesUnloading, sender, e); 237 else { 238 int nrOfAssemblies = e.Value.Count(); 239 if (nrOfAssemblies > SilentAssemblyLoadingOperationLimit) 240 AddProgressView(AssembliesUnloadingMessage); 241 } 242 } 243 244 private void codeEditor_AssembliesUnloaded(object sender, EventArgs<IEnumerable<Assembly>> e) { 245 if (InvokeRequired) Invoke((Action<object, EventArgs<IEnumerable<Assembly>>>)codeEditor_AssembliesUnloaded, sender, e); 246 else { 247 RemoveProgressView(); 248 } 249 } 198 250 } 199 251 }
Note: See TracChangeset
for help on using the changeset viewer.