using System;
using System.Runtime.Serialization;
using Valg.EVA.Skanning.Resources.Language;
using Valg.EVA.Skanning.UserInterfaceElements.MessageBox;

namespace Valg.EVA.Skanning.UserInterfaceElements.ErrorHandling
{
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors"), Serializable]
    public class DatabaseCompatibilityPresentationException : Exception, IException
    {
        public DatabaseCompatibilityPresentationException()
        { }

        public DatabaseCompatibilityPresentationException(string currentDatabaseVersion, string expectedDatabaseVersion)
            : base(string.Format(@"Mismatch between application and database version. The application expects version '{0}', but the database has version '{1}'.", expectedDatabaseVersion, currentDatabaseVersion)) { }

        public DatabaseCompatibilityPresentationException(string message)
            : base(message)
        { }

        public DatabaseCompatibilityPresentationException(string message, Exception innerException)
            : base(message, innerException)
        { }

        protected DatabaseCompatibilityPresentationException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }

        
        
        
        
        public string Title { get { return LanguageString.Title_Error; } }

        
        
        
        
        public string Problem { get { return LanguageString.Error_DatabaseCompatibility; } }

        
        
        
        
        public string Solution { get { return LanguageString.Error_DatabaseCompatibility_Solution; } }

        public MessageBoxType MessageBoxType { get { return MessageBoxType.Error; } }
    }
}
