BaseApplicationConfiguration.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Xml.Serialization;
  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. public class BaseApplicationConfiguration
  11. {
  12. /// <summary>
  13. /// The number of days we should retain log files
  14. /// </summary>
  15. /// <value>The log file retention days.</value>
  16. public int LogFileRetentionDays { get; set; }
  17. /// <summary>
  18. /// Gets or sets a value indicating whether this instance is first run.
  19. /// </summary>
  20. /// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
  21. public bool IsStartupWizardCompleted { get; set; }
  22. /// <summary>
  23. /// Gets or sets the cache path.
  24. /// </summary>
  25. /// <value>The cache path.</value>
  26. public string CachePath { get; set; }
  27. /// <summary>
  28. /// Last known version that was ran using the configuration.
  29. /// </summary>
  30. /// <value>The version from previous run.</value>
  31. [XmlIgnore]
  32. public Version PreviousVersion { get; set; }
  33. /// <summary>
  34. /// Stringified PreviousVersion to be stored/loaded,
  35. /// because System.Version itself isn't xml-serializable
  36. /// </summary>
  37. /// <value>String value of PreviousVersion</value>
  38. public string PreviousVersionStr
  39. {
  40. get => PreviousVersion?.ToString();
  41. set => PreviousVersion = Version.Parse(value);
  42. }
  43. /// <summary>
  44. /// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
  45. /// </summary>
  46. public BaseApplicationConfiguration()
  47. {
  48. LogFileRetentionDays = 3;
  49. }
  50. }
  51. }