using System;

namespace InABox.Core
{
    public abstract class DFLayoutElement : DFLayoutControl { }

    public abstract class DFLayoutElement<TProperties> : DFLayoutElement
    {
        [NullEditor]
        public TProperties Properties { get; set; }

        protected override void LoadProperties()
        {
            base.LoadProperties();

            Properties = Serialization.Deserialize<TProperties>(GetProperty("Properties", ""));
        }

        protected override void SaveProperties()
        {
            base.SaveProperties();
            SetProperty("Properties", Serialization.Serialize(Properties));
        }
    }
}