IDigitalFormDataModel.cs 982 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. namespace InABox.Core
  3. {
  4. public delegate void DigitalFormUpdateHandler(IDigitalFormDataModel model);
  5. public delegate void DigitalFormBeforeUpdateHandler(IDigitalFormDataModel model);
  6. public interface IDigitalFormDataModel
  7. {
  8. public Entity Entity { get; set; }
  9. IDigitalFormInstance Instance { get; set; }
  10. event DigitalFormUpdateHandler OnModelSaved;
  11. event DigitalFormBeforeUpdateHandler BeforeModelSaved;
  12. void Load(Action<IDigitalFormDataModel> callback);
  13. /// <summary>
  14. /// Saves the datamodel to the database, including the form instance and parent entity.
  15. /// </summary>
  16. /// <param name="callback">The callback to call once the update is finished, or <c>null</c> for synchronous execution.</param>
  17. void Update(Action<IDigitalFormDataModel>? callback);
  18. object? GetEntityValue(string name);
  19. void SetEntityValue(string name, object? value);
  20. }
  21. }