Changeset 11765
- Timestamp:
- 01/15/15 13:45:49 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CodeEditor/HeuristicLab.Scripting.Views/3.3/ScriptView.cs
r11700 r11765 136 136 Locked = false; 137 137 codeEditor.Focus(); 138 //OnContentChanged();139 138 } 140 139 } … … 172 171 ch.Width = -2; 173 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 174 190 #endregion 175 191 176 192 #region Event Handlers 177 193 private void Content_CodeChanged(object sender, EventArgs e) { 178 if (InvokeRequired) 179 Invoke(new EventHandler(Content_CodeChanged), sender, e); 194 if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_CodeChanged, sender, e); 180 195 else { 181 196 codeEditor.UserCode = Content.Code; … … 203 218 204 219 private void codeEditor_AssembliesLoading(object sender, EventArgs<IEnumerable<Assembly>> e) { 205 if (e.Value.Count() <= SilentAssemblyLoadingOperationLimit) return; 206 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 207 mainForm.AddOperationProgressToView(this, AssembliesLoadingMessage); 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 } 208 226 } 209 227 210 228 private void codeEditor_AssembliesLoaded(object sender, EventArgs<IEnumerable<Assembly>> e) { 211 if (e.Value.Count() <= SilentAssemblyLoadingOperationLimit) return; 212 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 213 mainForm.RemoveOperationProgressFromView(this); 229 if (InvokeRequired) Invoke((Action<object, EventArgs<IEnumerable<Assembly>>>)codeEditor_AssembliesLoaded, sender, e); 230 else { 231 RemoveProgressView(); 232 } 214 233 } 215 234 216 235 private void codeEditor_AssembliesUnloading(object sender, EventArgs<IEnumerable<Assembly>> e) { 217 if (e.Value.Count() <= SilentAssemblyLoadingOperationLimit) return; 218 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 219 mainForm.AddOperationProgressToView(this, AssembliesUnloadingMessage); 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 } 220 242 } 221 243 222 244 private void codeEditor_AssembliesUnloaded(object sender, EventArgs<IEnumerable<Assembly>> e) { 223 if (e.Value.Count() <= SilentAssemblyLoadingOperationLimit) return; 224 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 225 mainForm.RemoveOperationProgressFromView(this); 245 if (InvokeRequired) Invoke((Action<object, EventArgs<IEnumerable<Assembly>>>)codeEditor_AssembliesUnloaded, sender, e); 246 else { 247 RemoveProgressView(); 248 } 226 249 } 227 250 }
Note: See TracChangeset
for help on using the changeset viewer.