68 lines
1.9 KiB
C#
68 lines
1.9 KiB
C#
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Xml.Serialization;
|
|
|
|
namespace D2Multi
|
|
{
|
|
public class D2Account : INotifyPropertyChanged
|
|
{
|
|
private string _name;
|
|
private string _email;
|
|
private string _encryptedPassword;
|
|
private string _password;
|
|
|
|
public string Name
|
|
{
|
|
get => _name;
|
|
set { if (_name == value) return; _name = value; OnPropertyChanged(nameof(Name)); }
|
|
}
|
|
|
|
public string Email
|
|
{
|
|
get => _email;
|
|
set { if (_email == value) return; _email = value; OnPropertyChanged(nameof(Email)); }
|
|
}
|
|
|
|
/// <summary>DPAPI-protected secret, Base64. Persisted to XML only.</summary>
|
|
public string EncryptedPassword
|
|
{
|
|
get => _encryptedPassword;
|
|
set { if (_encryptedPassword == value) return; _encryptedPassword = value; OnPropertyChanged(nameof(EncryptedPassword)); }
|
|
}
|
|
|
|
/// <summary>Transient plain text for editing; never written to XML.</summary>
|
|
[XmlIgnore]
|
|
public string Password
|
|
{
|
|
get => _password;
|
|
set { if (_password == value) return; _password = value; OnPropertyChanged(nameof(Password)); }
|
|
}
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
void OnPropertyChanged(string name) =>
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
|
|
|
|
public List<D2Character> Characters { get; set; }
|
|
}
|
|
|
|
public class D2Character
|
|
{
|
|
public string Name { get; set; }
|
|
public string Class { get; set; }
|
|
public List<D2Mission> Missions { get; set; }
|
|
}
|
|
public enum D2Level
|
|
{
|
|
Normal,
|
|
Nightmare,
|
|
Hell
|
|
}
|
|
public class D2Mission
|
|
{
|
|
public D2Level Level { get; set; }
|
|
public bool A1_Enpowered { get; set; }
|
|
public bool A5_Socket { get; set; }
|
|
}
|
|
}
|