using MECF.Framework.Common.CommonData;
using System;
using System.Runtime.Serialization;

namespace MECF.Framework.Common.Aitex.Core.RT.EMS
{
    [Serializable]
    [DataContract]
    public class MaintainerItemInfo:NotifiableItem
    {
        #region Basic Property

        [DataMember]
        public string UID { get; set; }

        [DataMember]
        public bool Enable { get; set; }

        [DataMember]
        public DateTime MaintainedDate { get; set; }

        [DataMember]
        public bool IsMaintained { get; set; }

        #endregion

        #region Description Property

        [DataMember]
        public MaintainerItemConfigInfo Config { get; set; }

        #endregion

        public void Update(MaintainerItemInfo newinfo)
        {
            Config.Name = newinfo.Config.Name;
            Config.UID = newinfo.Config.UID;
            Config.Index  = newinfo.Config.Index;
            Config.ParentName = newinfo.Config.ParentName;
            Config.Description = newinfo.Config.Description;
            Config.DefaultRecord = newinfo.Config.DefaultRecord;
            Config.FilePath = newinfo.Config.FilePath;

            MaintainedDate = newinfo.MaintainedDate;
            IsMaintained = newinfo.IsMaintained;

            InvokePropertyChanged();
        }
    }
}
