Files
Umbraco-CMS/src/Umbraco.Core/Models/UserTourStatus.cs

61 lines
1.7 KiB
C#
Raw Normal View History

2018-03-27 10:04:07 +02:00
using System;
using System.Runtime.Serialization;
namespace Umbraco.Cms.Core.Models
2018-03-27 10:04:07 +02:00
{
/// <summary>
/// A model representing the tours a user has taken/completed
/// </summary>
[DataContract(Name = "userTourStatus", Namespace = "")]
public class UserTourStatus : IEquatable<UserTourStatus>
{
/// <summary>
/// The tour alias
/// </summary>
[DataMember(Name = "alias")]
2022-02-16 16:03:53 +01:00
public string Alias { get; set; } = string.Empty;
2018-03-27 10:04:07 +02:00
/// <summary>
/// If the tour is completed
/// </summary>
[DataMember(Name = "completed")]
public bool Completed { get; set; }
/// <summary>
/// If the tour is disabled
/// </summary>
[DataMember(Name = "disabled")]
public bool Disabled { get; set; }
2022-01-21 11:43:58 +01:00
public bool Equals(UserTourStatus? other)
2018-03-27 10:04:07 +02:00
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return string.Equals(Alias, other.Alias);
}
2022-01-21 11:43:58 +01:00
public override bool Equals(object? obj)
2018-03-27 10:04:07 +02:00
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((UserTourStatus) obj);
}
public override int GetHashCode()
{
return Alias.GetHashCode();
}
2022-04-01 11:09:51 +02:00
public static bool operator ==(UserTourStatus? left, UserTourStatus? right)
2018-03-27 10:04:07 +02:00
{
return Equals(left, right);
}
2022-04-01 11:09:51 +02:00
public static bool operator !=(UserTourStatus? left, UserTourStatus? right)
2018-03-27 10:04:07 +02:00
{
return !Equals(left, right);
}
}
}