PosterSettings.cs 825 B

123456789101112131415161718192021222324252627282930
  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. }