PosterSettings.cs 1007 B

12345678910111213141516171819202122232425262728293031323334353637
  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; } = false;
  18. [ScriptEditor]
  19. public string Script { get; set; } = "";
  20. public abstract string DefaultScript(Type TPostable);
  21. public string DefaultScript<TPostable>() where TPostable : Entity, IPostable
  22. {
  23. return DefaultScript(typeof(TPostable));
  24. }
  25. }
  26. public interface IGlobalPosterSettings : IGlobalConfigurationSettings
  27. {
  28. }
  29. public abstract class GlobalPosterSettings : BaseObject, IGlobalPosterSettings
  30. {
  31. }
  32. }