| using System; |
| using System; |
| using System.Collections.Generic; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Linq; |
| using System.Text; |
| using System.Text; |
| using System.Threading.Tasks; |
| using System.Threading.Tasks; |
| |
| |
| namespace Playnite.SDK.Models |
| namespace Playnite.SDK.Models |
| { |
| { |
| /// <summary> |
| /// <summary> |
| /// Describes Region object. |
| /// Describes Region object. |
| /// </summary> |
| /// </summary> |
| public class Region : DatabaseObject |
| public class Region : DatabaseObject |
| { |
| { |
. | |
| private string specificationId; |
| |
| /// <summary> |
| |
| /// Gets or sets specification identifier. |
| |
| /// </summary> |
| |
| public string SpecificationId |
| |
| { |
| |
| get => specificationId; |
| |
| set |
| |
| { |
| |
| specificationId = value; |
| |
| OnPropertyChanged(); |
| |
| } |
| |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Creates new instance of <see cref="Region"/>. |
| /// Creates new instance of <see cref="Region"/>. |
| /// </summary> |
| /// </summary> |
| public Region() : base() |
| public Region() : base() |
| { |
| { |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Creates new instance of <see cref="Region"/>. |
| /// Creates new instance of <see cref="Region"/>. |
| /// </summary> |
| /// </summary> |
| /// <param name="name"></param> |
| /// <param name="name"></param> |
| public Region(string name) : base() |
| public Region(string name) : base() |
| { |
| { |
| Name = name; |
| Name = name; |
| } |
| } |
| |
| |
| /// <summary> |
| /// <summary> |
| /// Gets empty region. |
| /// Gets empty region. |
| /// </summary> |
| /// </summary> |
| public static readonly Region Empty = new Region { Id = Guid.Empty, Name = string.Empty }; |
| public static readonly Region Empty = new Region { Id = Guid.Empty, Name = string.Empty }; |
. | |
| |
| |
| /// <inheritdoc/> |
| |
| public override void CopyDiffTo(object target) |
| |
| { |
| |
| base.CopyDiffTo(target); |
| |
| |
| |
| if (target is Region tro) |
| |
| { |
| |
| if (!string.Equals(SpecificationId, tro.SpecificationId, StringComparison.Ordinal)) |
| |
| { |
| |
| tro.SpecificationId = SpecificationId; |
| |
| } |
| |
| } |
| |
| else |
| |
| { |
| |
| throw new ArgumentException($"Target object has to be of type {GetType().Name}"); |
| |
| } |
| |
| } |
| } |
| } |
| } |
| } |
| |
| |