using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VSview
{
    public class Status : BaseViewModel
    {
        #region Constructors
        /// <summary>
        /// Default constructor
        /// </summary>
        public Status()
        {

        }

        /// <summary>
        /// Main constructor
        /// </summary>
        /// <param name="name">Name of Status</param>
        /// <param name="description"></param>
        public Status(string name, string description, bool isError)
        {
            Name = name;
            Description = description;
            IsError = isError;
        }
        #endregion

        /// <summary>
        /// Date when state got active
        /// </summary>
        public string Date { get; set; }

        /// <summary>
        /// Time when state got active
        /// </summary>
        public string Time { get; set; }

        /// <summary>
        /// Name of state
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Description of state
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// Determines if status is error or warning
        /// </summary>
        public bool IsError { get; set; }

        private bool _isActive;
        /// <summary>
        /// Determines if state should be visible in state collection
        /// </summary>
        public bool IsActive
        {
            get { return _isActive; }
            set
            {
                _isActive = value;
                if (value == true)
                {
                    Time = DateTime.Now.ToString("HH:mm:ss");
                    Date = DateTime.Now.ToString("dd/MM/yyyy");
                }
            }
        }
    }
}
