| 12345678910111213141516171819202122232425262728293031323334353637 | namespace InABox.Core{    public class DFLayoutPINFieldProperties : DFLayoutFieldProperties<string>    {        public int Length { get; set; }        public DFLayoutPINFieldProperties()        {            Length = 4;        }        public override string FormatValue(object value)        {            return value?.ToString() ?? "";        }        public override object? ParseValue(object value)        {            if (value is int)                return value.ToString();            if (value is string) return value;            return null;        }        protected override void LoadProperties()        {            base.LoadProperties();            Length = GetProperty("Length", 4);        }        protected override void SaveProperties()        {            base.SaveProperties();            SetProperty("Length", Length);        }    }}
 |