PosterSettings.cs 956 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using InABox.Configuration;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Reflection;
  6. using System.Text;
  7. namespace InABox.Core
  8. {
  9. /// <summary>
  10. /// The settings for a given <see cref="IPoster{TEntity, TSettings}"/>.
  11. /// </summary>
  12. public abstract class PosterSettings : BaseObject, IGlobalConfigurationSettings
  13. {
  14. [NullEditor]
  15. public string PostableType { get; set; }
  16. [CheckBoxEditor]
  17. public bool ScriptEnabled { get; set; }
  18. [ScriptEditor]
  19. public string Script { get; set; }
  20. protected override void Init()
  21. {
  22. base.Init();
  23. Script = "";
  24. ScriptEnabled = false;
  25. }
  26. public abstract string DefaultScript(Type TPostable);
  27. public string DefaultScript<TPostable>() where TPostable : Entity, IPostable
  28. {
  29. return DefaultScript(typeof(TPostable));
  30. }
  31. }
  32. }