TimberlinePosterEngine.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using InABox.Core;
  2. using InABox.Core.Postable;
  3. using InABox.Poster.Shared;
  4. using InABox.Scripting;
  5. using System.Collections.Generic;
  6. using System.Formats.Asn1;
  7. using System.Globalization;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace InABox.Poster.Timberline;
  12. public class TimberlinePosterEngine<TPostable, TSettings> : BasePosterEngine<TPostable, ITimberlinePoster<TPostable, TSettings>, TSettings>
  13. where TPostable : Entity, IPostable, IRemotable, IPersistent, new()
  14. where TSettings : TimberlinePosterSettings<TPostable>, new()
  15. {
  16. protected override ITimberlinePoster<TPostable, TSettings> CreatePoster()
  17. {
  18. var poster = base.CreatePoster();
  19. poster.Script = GetScriptDocument();
  20. return poster;
  21. }
  22. public override bool BeforePost(IDataModel<TPostable> model)
  23. {
  24. return Poster.BeforePost(model);
  25. }
  26. protected override IPostResult<TPostable> DoProcess(IDataModel<TPostable> model)
  27. {
  28. return Poster.Process(model);
  29. }
  30. public override void AfterPost(IDataModel<TPostable> model, IPostResult<TPostable> result)
  31. {
  32. Poster.AfterPost(model, result);
  33. }
  34. }