using System; namespace InABox.Core { public delegate void DigitalFormUpdateHandler(IDigitalFormDataModel model); public delegate void DigitalFormBeforeUpdateHandler(IDigitalFormDataModel model); public interface IDigitalFormDataModel { public Entity Entity { get; set; } IDigitalFormInstance Instance { get; set; } public DigitalFormVariable[] Variables { get; set; } event DigitalFormUpdateHandler OnModelSaved; event DigitalFormBeforeUpdateHandler BeforeModelSaved; void Load(Action callback); /// /// Saves the datamodel to the database, including the form instance and parent entity. /// /// The callback to call once the update is finished, or null for synchronous execution. void Update(Action? callback); void DuplicateInstance(); object? GetEntityValue(string name); void SetEntityValue(string name, object? value); } }