Changeset 9363 for branches/OaaS/HeuristicLab.Optimizer/3.3/FileManager.cs
- Timestamp:
- 04/16/13 13:13:41 (11 years ago)
- Location:
- branches/OaaS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.Optimizer/3.3/FileManager.cs
r7259 r9363 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using System.Windows.Forms; … … 59 60 60 61 if (openFileDialog.ShowDialog() == DialogResult.OK) { 61 foreach (string filename in openFileDialog.FileNames) { 62 ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).SetAppStartingCursor(); 63 ContentManager.LoadAsync(filename, LoadingCompleted); 64 } 62 OpenFiles(openFileDialog.FileNames); 65 63 } 66 64 } 65 66 public static void OpenFiles(IEnumerable<string> fileNames) { 67 foreach (string filename in fileNames) { 68 ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).SetAppStartingCursor(); 69 ContentManager.LoadAsync(filename, LoadingCompleted); 70 } 71 } 72 67 73 private static void LoadingCompleted(IStorableContent content, Exception error) { 68 74 try { … … 143 149 private static void SetEnabledStateOfContentViews(IStorableContent content, bool enabled) { 144 150 HeuristicLab.MainForm.WindowsForms.MainForm mainForm = MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>(); 145 if (mainForm.InvokeRequired)146 mainForm.Invoke((Action<IStorableContent, bool>)SetEnabledStateOfContentViews, content, enabled);147 else {151 #region Mono Compatibility 152 // removed the InvokeRequired check because of Mono 153 mainForm.Invoke((Action)delegate { 148 154 var views = MainFormManager.MainForm.Views.OfType<IContentView>().Where(v => v.Content == content).ToList(); 149 155 views.ForEach(v => v.Enabled = enabled); 150 } 156 }); 157 #endregion 151 158 } 152 159 }
Note: See TracChangeset
for help on using the changeset viewer.