using System; using System.Diagnostics; using System.Runtime.Serialization; using Deltares.Stability; using Deltares.Standard.Project; namespace Deltares.MStab.IO.Classic { [Serializable] public class HeaderException : Exception { // // For guidelines regarding the creation of new exception types, see // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp // and // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp // public HeaderException() {} public HeaderException(string message) : base(message) {} public HeaderException(string message, Exception inner) : base(message, inner) {} protected HeaderException( SerializationInfo info, StreamingContext context) : base(info, context) {} } internal class Header { /// /// Create new ProjectIdentification from classic MStab inputfile /// public void GetHeaderInfo(int handle, string aClassicFileName, Project projectInfo) { try { //Project Identification ClassicMStabFunctionDefinitions.MStabIdentificationTitles identificationTitles = null; GetClassicMStab.GetClassicIdentificationTitles(handle, ref identificationTitles); projectInfo.Title1 = identificationTitles.projectTitle1; projectInfo.Title2 = identificationTitles.projectTitle2; projectInfo.Title3 = identificationTitles.projectTitle3; } catch { Debug.Assert(false, "Error in header, could not get Header info"); } } } }