Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/TimeSerieCollection.cs
===================================================================
diff -u -r2089 -r2628
--- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/TimeSerieCollection.cs (.../TimeSerieCollection.cs) (revision 2089)
+++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/TimeSerieCollection.cs (.../TimeSerieCollection.cs) (revision 2628)
@@ -32,15 +32,36 @@
public class TimeSerieCollection
{
-
+ ///
+ /// Initializes a new instance of the class.
+ ///
public TimeSerieCollection()
{
this.Series = new List();
}
+ ///
+ /// Gets or sets the series.
+ ///
+ ///
+ /// The series.
+ ///
public List Series { get; set; }
+ ///
+ /// Gets or sets the version.
+ ///
+ ///
+ /// The version.
+ ///
public string Version { get; set; }
+
+ ///
+ /// Gets or sets the time zone.
+ ///
+ ///
+ /// The time zone.
+ ///
public double TimeZone { get; set; }
///
@@ -73,14 +94,20 @@
/// The loaded time serie collection
public static TimeSerieCollection LoadFromFile(string fileName, bool validateWithEmbeddedXsd)
{
- string message;
- var assembler = new TimeSeriesAssembler();
- var doc = XDocument.Load(fileName);
- if (validateWithEmbeddedXsd)
- if (!assembler.ValidateSchema(doc, out message))
- throw new TimeSerieSchemaValidationException(message);
-
- return assembler.CreateDomainObject(doc);
+ try
+ {
+ string message;
+ var assembler = new TimeSeriesAssembler();
+ var doc = XDocument.Load(fileName);
+ if (validateWithEmbeddedXsd)
+ if (!assembler.ValidateSchema(doc, out message))
+ throw new TimeSerieSchemaValidationException(message);
+ return assembler.CreateDomainObject(doc);
+ }
+ catch (Exception e)
+ {
+ throw new TimeSerieSchemaValidationException(fileName + ": " + e.Message);
+ }
}
///
Index: DamClients/DamUI/trunk/src/Dam/Application/Program.cs
===================================================================
diff -u -r2598 -r2628
--- DamClients/DamUI/trunk/src/Dam/Application/Program.cs (.../Program.cs) (revision 2598)
+++ DamClients/DamUI/trunk/src/Dam/Application/Program.cs (.../Program.cs) (revision 2628)
@@ -21,6 +21,7 @@
using System;
using System.Drawing;
+using System.Text;
using Deltares.Dam.Data.License;
using Deltares.Dam.Forms;
using Deltares.Geometry.Forms;
@@ -185,9 +186,14 @@
return;
// Show message box
- string exceptionMessage = LocalizationManager.GetTranslatedText(null, "UnhandledExceptionMessage");
- LocalizedMessageBox.ShowException(String.Concat(exceptionMessage,": ",ex.Message,ex.StackTrace));
-
+ var exceptionMessage = new StringBuilder();
+ if (ex.InnerException != null)
+ {
+ exceptionMessage.Append(ex.InnerException.Message);
+ exceptionMessage.AppendLine();
+ }
+ exceptionMessage.Append(LocalizationManager.GetTranslatedText(null, "UnhandledExceptionMessage"));
+ LocalizedMessageBox.ShowException(String.Concat(exceptionMessage.ToString(),": ",ex.Message,ex.StackTrace));
System.Windows.Forms.Application.Exit();
}
}
Index: DamClients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs
===================================================================
diff -u -r2588 -r2628
--- DamClients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs (.../DamPlugin.cs) (revision 2588)
+++ DamClients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs (.../DamPlugin.cs) (revision 2628)
@@ -871,8 +871,15 @@
}
else if (sender == this.damProject.DamProjectData.WaterBoard)
{
- this.damProject.ImportWaterLevelTimeSeries();
- this.locationJobSymbol.Update(this.damProject.DamProjectData.LocationJobs);
+ try
+ {
+ this.damProject.ImportWaterLevelTimeSeries();
+ this.locationJobSymbol.Update(this.damProject.DamProjectData.LocationJobs);
+ }
+ catch (TimeSerieSchemaValidationException exception)
+ {
+ LocalizedMessageBox.ShowError(this, exception.Message);
+ }
}
else if (sender == currentLocationJob && sender != null)
{