using System;

namespace InABox.Core
{
    public class CodePopupEditor : DataLookupEditor
    {
        public CodePopupEditor(Type type, params string[] otherfields) : base(type, otherfields)
        {
        }

        public string CodeColumn { get; set; }

        public bool CanAdd { get; set; } = false;
        
        public Action<object> OnCreateItem { get; set; }

        protected override BaseEditor DoClone()
        {
            var result = (CloneDataLookupEditor() as CodePopupEditor)!;
            result.CanAdd = CanAdd;
            result.CodeColumn = CodeColumn;
            return result;
        }
    }
}