Changeset 9849 for trunk/sources/HeuristicLab.Optimizer
- Timestamp:
- 08/05/13 16:16:31 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/FileManager.cs
r9456 r9849 22 22 using System; 23 23 using System.Collections.Generic; 24 using System. Linq;24 using System.IO; 25 25 using System.Windows.Forms; 26 26 using HeuristicLab.Common; … … 98 98 SaveAs(view); 99 99 else { 100 ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).SetAppStartingCursor();100 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().SetAppStartingCursor(); 101 101 SetEnabledStateOfContentViews(content, false); 102 102 ContentManager.SaveAsync(content, content.Filename, true, SavingCompleted); … … 123 123 124 124 if (saveFileDialog.ShowDialog() == DialogResult.OK) { 125 ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).SetAppStartingCursor();125 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().SetAppStartingCursor(); 126 126 SetEnabledStateOfContentViews(content, false); 127 127 if (saveFileDialog.FilterIndex == 1) { … … 135 135 private static void SavingCompleted(IStorableContent content, Exception error) { 136 136 try { 137 SetEnabledStateOfContentViews(content, true);138 137 if (error != null) throw error; 139 138 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().UpdateTitle(); … … 143 142 } 144 143 finally { 145 ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).ResetAppStartingCursor(); 144 SetEnabledStateOfContentViews(content, true); 145 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().ResetAppStartingCursor(); 146 146 } 147 147 } … … 152 152 // removed the InvokeRequired check because of Mono 153 153 mainForm.Invoke((Action)delegate { 154 var views = MainFormManager.MainForm.Views.OfType<IContentView>().Where(v => v.Content == content).ToList(); 155 views.ForEach(v => v.Enabled = enabled); 154 if (enabled) 155 mainForm.RemoveOperationProgressFromContent(content); 156 else 157 mainForm.AddOperationProgressToContent(content, new Progress(string.Format("Saving file \"{0}\"...", Path.GetFileName(content.Filename)))); 156 158 }); 157 159 #endregion
Note: See TracChangeset
for help on using the changeset viewer.