//
//    Copyright (C) 2010 Hiperscan GmbH Dresden, Germany
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.



using System;

namespace Hiperscan.GuiExtensions.Dialog
{
    public abstract class DialogArgsTempleate
    {
        public string CompleteErrorMessage
        {
            get
            {
                string message = String.Empty;

                switch (this.StandardDialogType)
                {
                    case StandardDialogType.Error:
                    case StandardDialogType.ErrorWithHelp:
                    case StandardDialogType.ErrorWithServiceMessage:
                    case StandardDialogType.ErrorWithQuesteion:
                        message = String.Format("Error: {0}", this.Message);
                        if (this.Exception != null)
                            message += "\n" + this.Exception.ToString();
                        break;

                    default:
                        break;
                }

                return message;
            }
        }

        public StandardDialogType StandardDialogType { get; set; } = StandardDialogType.None;
        public IconType IconType { get; set; } = IconType.None;
        public DialogRespnseType Response { get; set; } = DialogRespnseType.None;

        public string Title { get; set; } = String.Empty;
        public string Message { get; set; } = String.Empty;
        public bool UseMarkup { get; set; } = false;
        public Exception Exception { get; set; } = null;
        public bool WriteErrorToConsole { get; set; } = false;

        public string DontShowAgainMesssage { get; set; } = String.Empty;
        public bool DontShowAgain { get; set; } = false;

        public EventHandler EventHandler { get; set; } = null;
        public object EventHandlerObject { get; set; } = null;
        public EventArgs EventHandlerEventArgs { get; set; } = EventArgs.Empty;

        public uint TimeOutMilliSeconds { get; set; } = 0;
    }
}
