using System;

namespace InABox.Core
{
    public class DFLayoutImage : DFLayoutControl
    {
        public DFLayoutImage()
        {
            Image = new ImageDocumentLink();
        }

        [EditorSequence(0)]
        public ImageDocumentLink Image { get; set; }

        protected override string GetDescription()
        {
            return Image != null ? Image.FileName : "";
        }

        protected override void LoadProperties()
        {
            base.LoadProperties();
            Image.ID = GetProperty("Image.ID", Guid.Empty);
            Image.FileName = GetProperty("Image.FileName", "");
        }

        protected override void SaveProperties()
        {
            base.SaveProperties();
            SetProperty("Image.ID", Image.ID);
            SetProperty("Image.FileName", Image.FileName);
        }
    }
}