BaseApplicationConfiguration.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using MediaBrowser.Model.Updates;
  2. using ProtoBuf;
  3. namespace MediaBrowser.Model.Configuration
  4. {
  5. /// <summary>
  6. /// Serves as a common base class for the Server and UI application Configurations
  7. /// ProtoInclude tells Protobuf about subclasses,
  8. /// The number 50 can be any number, so long as it doesn't clash with any of the ProtoMember numbers either here or in subclasses.
  9. /// </summary>
  10. [ProtoContract, ProtoInclude(965, typeof(ServerConfiguration))]
  11. public class BaseApplicationConfiguration
  12. {
  13. /// <summary>
  14. /// Gets or sets a value indicating whether [enable debug level logging].
  15. /// </summary>
  16. /// <value><c>true</c> if [enable debug level logging]; otherwise, <c>false</c>.</value>
  17. [ProtoMember(1)]
  18. public bool EnableDebugLevelLogging { get; set; }
  19. /// <summary>
  20. /// Enable automatically and silently updating of the application
  21. /// </summary>
  22. /// <value><c>true</c> if [enable auto update]; otherwise, <c>false</c>.</value>
  23. [ProtoMember(3)]
  24. public bool EnableAutoUpdate { get; set; }
  25. /// <summary>
  26. /// Gets of sets a value indicating the level of system updates (Release, Beta, Dev)
  27. /// </summary>
  28. [ProtoMember(60)]
  29. public PackageVersionClass SystemUpdateLevel { get; set; }
  30. /// <summary>
  31. /// The number of days we should retain log files
  32. /// </summary>
  33. /// <value>The log file retention days.</value>
  34. [ProtoMember(5)]
  35. public int LogFileRetentionDays { get; set; }
  36. /// <summary>
  37. /// Gets or sets a value indicating whether [run at startup].
  38. /// </summary>
  39. /// <value><c>true</c> if [run at startup]; otherwise, <c>false</c>.</value>
  40. [ProtoMember(58)]
  41. public bool RunAtStartup { get; set; }
  42. /// <summary>
  43. /// Gets or sets a value indicating whether this instance is first run.
  44. /// </summary>
  45. /// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
  46. [ProtoMember(4)]
  47. public bool IsStartupWizardCompleted { get; set; }
  48. /// <summary>
  49. /// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
  50. /// </summary>
  51. public BaseApplicationConfiguration()
  52. {
  53. EnableAutoUpdate = true;
  54. LogFileRetentionDays = 14;
  55. #if (DEBUG)
  56. EnableDebugLevelLogging = true;
  57. #endif
  58. }
  59. }
  60. }