jellyfin/MediaBrowser.Model/Entities/MBRegistrationRecord.cs

29 lines
857 B
C#
Raw Normal View History

2013-02-21 02:33:05 +01:00
using System;
2013-06-10 18:57:30 +02:00
namespace MediaBrowser.Model.Entities
2013-02-21 02:33:05 +01:00
{
public class MBRegistrationRecord
{
public DateTime ExpirationDate { get; set; }
public bool IsRegistered { get; set;}
public bool RegChecked { get; set; }
public bool RegError { get; set; }
2013-02-21 02:33:05 +01:00
private bool? _isInTrial;
public bool TrialVersion
{
get
{
if (_isInTrial == null)
{
if (!RegChecked) return false; //don't set this until we've successfully obtained exp date
_isInTrial = ExpirationDate > DateTime.Now;
}
return (_isInTrial.Value && !IsRegistered);
}
}
public bool IsValid
{
get { return !RegChecked || (IsRegistered || TrialVersion); }
}
}
}