- Timestamp:
- 05/11/10 04:26:09 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 7 added
- 1 deleted
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/Clipboard.cs
r3694 r3758 28 28 using HeuristicLab.MainForm; 29 29 using HeuristicLab.Persistence.Default.Xml; 30 using HeuristicLab.PluginInfrastructure; 30 31 31 32 namespace HeuristicLab.Core.Views { … … 279 280 } 280 281 catch (Exception ex) { 281 Auxiliary.ShowErrorMessageBox(ex);282 ErrorHandling.ShowErrorDialog(this, ex); 282 283 } 283 284 } -
trunk/sources/HeuristicLab.Core.Views/3.3/CreateParameterDialog.cs
r2818 r3758 22 22 using System; 23 23 using System.Windows.Forms; 24 using HeuristicLab.PluginInfrastructure; 24 25 25 26 namespace HeuristicLab.Core.Views { … … 40 41 } 41 42 catch (Exception ex) { 42 Auxiliary.ShowErrorMessageBox(ex);43 ErrorHandling.ShowErrorDialog(this, ex); 43 44 } 44 45 return null; -
trunk/sources/HeuristicLab.Core.Views/3.3/HeuristicLab.Core.Views-3.3.csproj
r3702 r3758 153 153 <DependentUpon>CreateParameterDialog.cs</DependentUpon> 154 154 </Compile> 155 <Compile Include="Auxiliary.cs" />156 155 <Compile Include="EngineView.cs"> 157 156 <SubType>UserControl</SubType> -
trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.cs
r3709 r3758 27 27 using HeuristicLab.MainForm; 28 28 using HeuristicLab.MainForm.WindowsForms; 29 using HeuristicLab.PluginInfrastructure; 29 30 30 31 namespace HeuristicLab.Core.Views { … … 137 138 } 138 139 catch (Exception ex) { 139 Auxiliary.ShowErrorMessageBox(ex);140 ErrorHandling.ShowErrorDialog(this, ex); 140 141 } 141 142 } -
trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs
r3709 r3758 27 27 using HeuristicLab.MainForm; 28 28 using HeuristicLab.MainForm.WindowsForms; 29 using HeuristicLab.PluginInfrastructure; 29 30 30 31 namespace HeuristicLab.Core.Views { … … 112 113 } 113 114 catch (Exception ex) { 114 Auxiliary.ShowErrorMessageBox(ex);115 ErrorHandling.ShowErrorDialog(this, ex); 115 116 } 116 117 } -
trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs
r3709 r3758 27 27 using HeuristicLab.MainForm; 28 28 using HeuristicLab.MainForm.WindowsForms; 29 using HeuristicLab.PluginInfrastructure; 29 30 30 31 namespace HeuristicLab.Core.Views { … … 140 141 } 141 142 catch (Exception ex) { 142 Auxiliary.ShowErrorMessageBox(ex);143 ErrorHandling.ShowErrorDialog(this, ex); 143 144 } 144 145 } -
trunk/sources/HeuristicLab.Core.Views/3.3/OperatorCollectionView.cs
r3588 r3758 24 24 using HeuristicLab.Collections; 25 25 using HeuristicLab.MainForm; 26 using HeuristicLab.PluginInfrastructure; 26 27 27 28 namespace HeuristicLab.Core.Views { … … 52 53 } 53 54 catch (Exception ex) { 54 Auxiliary.ShowErrorMessageBox(ex);55 ErrorHandling.ShowErrorDialog(this, ex); 55 56 } 56 57 } -
trunk/sources/HeuristicLab.Core.Views/3.3/OperatorListView.cs
r3588 r3758 24 24 using HeuristicLab.Collections; 25 25 using HeuristicLab.MainForm; 26 using HeuristicLab.PluginInfrastructure; 26 27 27 28 namespace HeuristicLab.Core.Views { … … 52 53 } 53 54 catch (Exception ex) { 54 Auxiliary.ShowErrorMessageBox(ex);55 ErrorHandling.ShowErrorDialog(this, ex); 55 56 } 56 57 } -
trunk/sources/HeuristicLab.Core.Views/3.3/OperatorSetView.cs
r3588 r3758 24 24 using HeuristicLab.Collections; 25 25 using HeuristicLab.MainForm; 26 using HeuristicLab.PluginInfrastructure; 26 27 27 28 namespace HeuristicLab.Core.Views { … … 52 53 } 53 54 catch (Exception ex) { 54 Auxiliary.ShowErrorMessageBox(ex);55 ErrorHandling.ShowErrorDialog(this, ex); 55 56 } 56 57 } -
trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.cs
r3694 r3758 24 24 using HeuristicLab.Common; 25 25 using HeuristicLab.MainForm; 26 using HeuristicLab.PluginInfrastructure; 26 27 27 28 namespace HeuristicLab.Core.Views { … … 121 122 } 122 123 catch (Exception ex) { 123 Auxiliary.ShowErrorMessageBox(ex);124 ErrorHandling.ShowErrorDialog(this, ex); 124 125 } 125 126 } -
trunk/sources/HeuristicLab.Core/3.3/HeuristicLab.Core-3.3.csproj
r3702 r3758 136 136 <Compile Include="Constraints\IConstraint.cs" /> 137 137 <Compile Include="Constraints\TypeCompatibilityConstraint.cs" /> 138 <Compile Include="OperatorExecutionException.cs" /> 138 139 <Compile Include="Interfaces\IScopeTreeLookupParameter.cs" /> 139 140 <Compile Include="Interfaces\ICheckedItemList.cs" /> -
trunk/sources/HeuristicLab.Core/3.3/Log.cs
r3289 r3758 25 25 using HeuristicLab.Common; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.PluginInfrastructure; 27 28 28 29 namespace HeuristicLab.Core { … … 63 64 } 64 65 public virtual void LogException(Exception ex) { 65 string s = DateTime.Now.ToString() + "\t" + "Exception occurred:" + Environment.NewLine + BuildErrorMessage(ex);66 string s = DateTime.Now.ToString() + "\t" + "Exception occurred:" + Environment.NewLine + ErrorHandling.BuildErrorMessage(ex); 66 67 messages.Add(s); 67 68 OnMessageAdded(s); … … 78 79 if (handler != null) handler(this, EventArgs.Empty); 79 80 } 80 81 public static string BuildErrorMessage(Exception ex) {82 string nl = Environment.NewLine;83 string message = ex.Message + nl + ex.StackTrace;84 85 while (ex.InnerException != null) {86 ex = ex.InnerException;87 message += nl + "-----" + nl + ex.Message + nl + ex.StackTrace;88 }89 return message;90 }91 81 } 92 82 } -
trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperatorView.cs
r3455 r3758 37 37 using HeuristicLab.Operators.Views; 38 38 using HeuristicLab.MainForm; 39 using HeuristicLab.PluginInfrastructure; 39 40 40 41 namespace HeuristicLab.Operators.Programmable { … … 134 135 MessageBox.Show("Compilation successful", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); 135 136 } catch (Exception ex) { 136 Auxiliary.ShowErrorMessageBox(ex);137 ErrorHandling.ShowErrorDialog(this, ex); 137 138 } 138 139 OnContentChanged(); -
trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs
r3716 r3758 28 28 using HeuristicLab.MainForm; 29 29 using HeuristicLab.Persistence.Default.Xml; 30 using HeuristicLab.PluginInfrastructure; 30 31 31 32 namespace HeuristicLab.Optimization.Views { … … 155 156 Invoke(new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred), sender, e); 156 157 else 157 Auxiliary.ShowErrorMessageBox(e.Value);158 ErrorHandling.ShowErrorDialog(this, e.Value); 158 159 } 159 160 #endregion … … 172 173 } 173 174 catch (Exception ex) { 174 Auxiliary.ShowErrorMessageBox(ex);175 ErrorHandling.ShowErrorDialog(this, ex); 175 176 } 176 177 } … … 196 197 } 197 198 catch (Exception ex) { 198 Invoke(new Action(() => Auxiliary.ShowErrorMessageBox(ex)));199 Invoke(new Action(() => ErrorHandling.ShowErrorDialog(this, ex))); 199 200 } 200 201 finally { -
trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.cs
r3716 r3758 27 27 using HeuristicLab.MainForm; 28 28 using HeuristicLab.Persistence.Default.Xml; 29 using HeuristicLab.PluginInfrastructure; 29 30 30 31 namespace HeuristicLab.Optimization.Views { … … 120 121 Invoke(new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred), sender, e); 121 122 else 122 Auxiliary.ShowErrorMessageBox(e.Value);123 ErrorHandling.ShowErrorDialog(this, e.Value); 123 124 } 124 125 private void Content_AlgorithmChanged(object sender, EventArgs e) { … … 157 158 } 158 159 catch (Exception ex) { 159 Auxiliary.ShowErrorMessageBox(ex);160 ErrorHandling.ShowErrorDialog(this, ex); 160 161 } 161 162 } … … 177 178 } 178 179 catch (Exception ex) { 179 Auxiliary.ShowErrorMessageBox(ex);180 ErrorHandling.ShowErrorDialog(this, ex); 180 181 } 181 182 finally { -
trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentView.cs
r3716 r3758 26 26 using HeuristicLab.Core.Views; 27 27 using HeuristicLab.MainForm; 28 using HeuristicLab.PluginInfrastructure; 28 29 29 30 namespace HeuristicLab.Optimization.Views { … … 110 111 Invoke(new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred), sender, e); 111 112 else 112 Auxiliary.ShowErrorMessageBox(e.Value);113 ErrorHandling.ShowErrorDialog(this, e.Value); 113 114 } 114 115 #endregion -
trunk/sources/HeuristicLab.Optimization.Views/3.3/OptimizerListView.cs
r3588 r3758 26 26 using HeuristicLab.Core.Views; 27 27 using HeuristicLab.MainForm; 28 using HeuristicLab.PluginInfrastructure; 28 29 29 30 namespace HeuristicLab.Optimization.Views { … … 54 55 } 55 56 catch (Exception ex) { 56 Auxiliary.ShowErrorMessageBox(ex);57 ErrorHandling.ShowErrorDialog(this, ex); 57 58 } 58 59 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintCollectionView.cs
r3632 r3758 26 26 using HeuristicLab.Optimization; 27 27 using System.Drawing; 28 using HeuristicLab.PluginInfrastructure; 28 29 29 30 namespace HeuristicLab.Core.Views { … … 54 55 } 55 56 catch (Exception ex) { 56 Auxiliary.ShowErrorMessageBox(ex);57 ErrorHandling.ShowErrorDialog(this, ex); 57 58 } 58 59 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.cs
r3725 r3758 27 27 using HeuristicLab.MainForm; 28 28 using HeuristicLab.Persistence.Default.Xml; 29 using HeuristicLab.PluginInfrastructure; 29 30 30 31 namespace HeuristicLab.Optimization.Views { … … 90 91 } 91 92 catch (Exception ex) { 92 Auxiliary.ShowErrorMessageBox(ex);93 ErrorHandling.ShowErrorDialog(this, ex); 93 94 } 94 95 finally { -
trunk/sources/HeuristicLab.Optimizer/3.3/FileManager.cs
r3557 r3758 26 26 using HeuristicLab.Core.Views; 27 27 using HeuristicLab.MainForm; 28 using HeuristicLab.PluginInfrastructure; 28 29 29 30 namespace HeuristicLab.Optimizer { … … 73 74 } 74 75 catch (Exception ex) { 75 Auxiliary.ShowErrorMessageBox(ex);76 ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, "Cannot open file.", ex); 76 77 } 77 78 finally { … … 133 134 } 134 135 catch (Exception ex) { 135 Auxiliary.ShowErrorMessageBox(ex);136 ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, "Cannot save file.", ex); 136 137 } 137 138 finally { -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.cs
r3694 r3758 26 26 using HeuristicLab.Core.Views; 27 27 using HeuristicLab.MainForm; 28 using HeuristicLab.PluginInfrastructure; 28 29 29 30 namespace HeuristicLab.Parameters.Views { … … 133 134 } 134 135 catch (Exception ex) { 135 Auxiliary.ShowErrorMessageBox(ex);136 ErrorHandling.ShowErrorDialog(this, ex); 136 137 } 137 138 } -
trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs
r3694 r3758 26 26 using HeuristicLab.Core.Views; 27 27 using HeuristicLab.MainForm; 28 using HeuristicLab.PluginInfrastructure; 28 29 29 30 namespace HeuristicLab.Parameters.Views { … … 121 122 } 122 123 catch (Exception ex) { 123 Auxiliary.ShowErrorMessageBox(ex);124 ErrorHandling.ShowErrorDialog(this, ex); 124 125 } 125 126 } -
trunk/sources/HeuristicLab.PluginInfrastructure/HeuristicLab.PluginInfrastructure.csproj
r3754 r3758 194 194 <Compile Include="BaseClasses\PluginBase.cs" /> 195 195 <Compile Include="DefaultApplicationManager.cs" /> 196 <Compile Include="ErrorHandling\ErrorDialog.cs"> 197 <SubType>Form</SubType> 198 </Compile> 199 <Compile Include="ErrorHandling\ErrorDialog.Designer.cs"> 200 <DependentUpon>ErrorDialog.cs</DependentUpon> 201 </Compile> 202 <Compile Include="ErrorHandling\ErrorHandling.cs"> 203 </Compile> 196 204 <Compile Include="LightweightApplicationManager.cs" /> 197 205 <Compile Include="Interfaces\IPluginFile.cs" /> … … 260 268 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 261 269 </Content> 270 <None Include="Resources\Error.ico" /> 262 271 <Content Include="Resources\HeuristicLab.ico" /> 263 272 <Content Include="Resources\Logo_white.gif" /> … … 265 274 <Content Include="Resources\VS2008ImageLibrary_Actions_PublishToWebHS.png" /> 266 275 <Content Include="Resources\VS2008ImageLibrary_Actions_RepeatHS.png" /> 276 <None Include="Resources\VS2008ImageLibrary_Annotations_Error.png" /> 267 277 <Content Include="Resources\VS2008ImageLibrary_CommonElements_Actions_Add.png" /> 268 278 <Content Include="Resources\VS2008ImageLibrary_Objects_Plugin.png" /> -
trunk/sources/HeuristicLab.PluginInfrastructure/Main.cs
r3745 r3758 44 44 } 45 45 catch (Exception ex) { 46 ShowErrorMessageBox(ex);46 ErrorHandling.ShowErrorDialog(ex); 47 47 } 48 }49 50 private static void ShowErrorMessageBox(Exception ex) {51 MessageBox.Show(null,52 BuildErrorMessage(ex),53 "Error - " + ex.GetType().Name,54 MessageBoxButtons.OK,55 MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);56 }57 58 private static string BuildErrorMessage(Exception ex) {59 string nl = Environment.NewLine;60 StringBuilder sb = new StringBuilder();61 sb.Append(ex.Message + nl + ex.StackTrace);62 63 while (ex.InnerException != null) {64 ex = ex.InnerException;65 sb.Append(nl + "-----" + nl + ex.Message + nl + ex.StackTrace);66 }67 return sb.ToString();68 48 } 69 49 } -
trunk/sources/HeuristicLab.PluginInfrastructure/Resources.Designer.cs
r3752 r3758 2 2 // <auto-generated> 3 3 // This code was generated by a tool. 4 // Runtime Version:2.0.50727.4 2004 // Runtime Version:2.0.50727.4927 5 5 // 6 6 // Changes to this file may cause incorrect behavior and will be lost if … … 96 96 } 97 97 98 internal static System.Drawing.Bitmap Error { 99 get { 100 object obj = ResourceManager.GetObject("Error", resourceCulture); 101 return ((System.Drawing.Bitmap)(obj)); 102 } 103 } 104 105 internal static System.Drawing.Icon ErrorIcon { 106 get { 107 object obj = ResourceManager.GetObject("ErrorIcon", resourceCulture); 108 return ((System.Drawing.Icon)(obj)); 109 } 110 } 111 98 112 internal static System.Drawing.Bitmap File { 99 113 get { -
trunk/sources/HeuristicLab.PluginInfrastructure/Resources.resx
r3752 r3758 134 134 <value>Resources\VS2008ImageLibrary_Objects_Document.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> 135 135 </data> 136 <data name="Error" type="System.Resources.ResXFileRef, System.Windows.Forms"> 137 <value>Resources\VS2008ImageLibrary_Annotations_Error.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> 138 </data> 139 <data name="ErrorIcon" type="System.Resources.ResXFileRef, System.Windows.Forms"> 140 <value>Resources\Error.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> 141 </data> 136 142 <data name="File" type="System.Resources.ResXFileRef, System.Windows.Forms"> 137 143 <value>Resources\VS2008ImageLibrary_Objects_File.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> -
trunk/sources/HeuristicLab.PluginInfrastructure/Starter/StarterForm.cs
r3748 r3758 153 153 catch (Exception ex) { 154 154 stopped = false; 155 ThreadPool.QueueUserWorkItem(delegate(object exception) { ShowErrorMessageBox((Exception)exception); }, ex);155 ThreadPool.QueueUserWorkItem(delegate(object exception) { ErrorHandling.ShowErrorDialog(this, (Exception)exception); }, ex); 156 156 Thread.Sleep(5000); // sleep 5 seconds before autorestart 157 157 } … … 179 179 } 180 180 181 private void ShowErrorMessageBox(Exception ex) {182 MessageBoxOptions options = RightToLeft == RightToLeft.Yes ? MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading : MessageBoxOptions.DefaultDesktopOnly;183 MessageBox.Show(null,184 BuildErrorMessage(ex),185 "Error - " + ex.GetType().Name,186 MessageBoxButtons.OK,187 MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, options);188 }189 private static string BuildErrorMessage(Exception ex) {190 string nl = Environment.NewLine;191 StringBuilder sb = new StringBuilder();192 sb.Append(ex.Message + nl + ex.StackTrace);193 194 while (ex.InnerException != null) {195 ex = ex.InnerException;196 sb.Append(nl + "-----" + nl + ex.Message + nl + ex.StackTrace);197 }198 return sb.ToString();199 }200 201 181 private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { 202 182 abortRequested = true; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisProblemDataView.cs
r3742 r3758 30 30 using HeuristicLab.Core.Views; 31 31 using HeuristicLab.MainForm; 32 using HeuristicLab.PluginInfrastructure; 32 33 33 34 namespace HeuristicLab.Problems.DataAnalysis.Views { … … 56 57 } 57 58 catch (Exception ex) { 58 Auxiliary.ShowErrorMessageBox(ex);59 ErrorHandling.ShowErrorDialog(this, ex); 59 60 } 60 61 } -
trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.cs
r3712 r3758 26 26 using HeuristicLab.Core.Views; 27 27 using HeuristicLab.MainForm; 28 using HeuristicLab.PluginInfrastructure; 28 29 29 30 namespace HeuristicLab.Problems.TravelingSalesman.Views { … … 95 96 } 96 97 catch (Exception ex) { 97 Auxiliary.ShowErrorMessageBox(ex);98 ErrorHandling.ShowErrorDialog(this, ex); 98 99 } 99 100 } -
trunk/sources/HeuristicLab.SequentialEngine/3.3/SequentialEngine.cs
r3376 r3758 60 60 catch (Exception ex) { 61 61 ExecutionStack.Push(operation); 62 OnExceptionOccurred( ex);62 OnExceptionOccurred(new OperatorExecutionException(operation.Operator, ex)); 63 63 Pause(); 64 64 }
Note: See TracChangeset
for help on using the changeset viewer.