using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Text;

namespace InABox.Core
{
    public class DFLayoutMultiSignaturePadProperties : DFLayoutFieldProperties<Dictionary<string, byte[]>, Dictionary<string, byte[]>?>
    {

        [EditorSequence(-995)]
        [NullEditor]
        public override Dictionary<string, byte[]> Default { get; set; } = new Dictionary<string, byte[]>();
        
        public override string FormatValue(Dictionary<string, byte[]>? value)
        {
            return value != null ? "Yes" : "";
        }

        public override Dictionary<string, byte[]>? DeserializeValue(DFLoadStorageEntry entry)
        {
            return entry.GetValue<Dictionary<string, byte[]>>();
        }

        public override void SerializeValue(DFSaveStorageEntry entry, Dictionary<string, byte[]>? value)
        {
            entry.SetValue(value);
        }

        public override Dictionary<string, byte[]> GetValue(Dictionary<string, byte[]>? value)
        {
            return value ?? Default;
        }
    }
}
