2021-05-16 04:12:47 +03:00
|
|
|
|
using MvvmCross;
|
|
|
|
|
using MvvmCross.Commands;
|
|
|
|
|
using MvvmCross.Navigation;
|
|
|
|
|
using MvvmCross.ViewModels;
|
|
|
|
|
using Newtonsoft.Json;
|
2021-05-14 14:07:19 +03:00
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using ProxySuper.Core.Models.Hosts;
|
|
|
|
|
using ProxySuper.Core.Models.Projects;
|
2021-05-16 04:12:47 +03:00
|
|
|
|
using ProxySuper.Core.ViewModels;
|
2021-05-14 14:07:19 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2021-05-22 12:14:27 +03:00
|
|
|
|
using System.IO;
|
2021-05-14 14:07:19 +03:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace ProxySuper.Core.Models
|
|
|
|
|
{
|
2021-05-23 09:24:13 +03:00
|
|
|
|
[JsonObject]
|
2021-05-16 04:12:47 +03:00
|
|
|
|
public class Record : MvxViewModel
|
2021-05-14 14:07:19 +03:00
|
|
|
|
{
|
2021-05-23 09:24:13 +03:00
|
|
|
|
private Host _host;
|
|
|
|
|
|
2021-05-16 04:12:47 +03:00
|
|
|
|
[JsonProperty("id")]
|
|
|
|
|
public string Id { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty("host")]
|
2021-05-23 09:24:13 +03:00
|
|
|
|
public Host Host
|
|
|
|
|
{
|
|
|
|
|
get { return _host; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_host = value;
|
|
|
|
|
RaisePropertyChanged("Host");
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-14 14:07:19 +03:00
|
|
|
|
|
|
|
|
|
[JsonProperty("settings")]
|
2021-05-16 04:12:47 +03:00
|
|
|
|
public XraySettings XraySettings { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty("trojanGoSettings")]
|
|
|
|
|
public TrojanGoSettings TrojanGoSettings { get; set; }
|
2021-05-14 14:07:19 +03:00
|
|
|
|
|
|
|
|
|
|
2021-05-16 04:12:47 +03:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public ProjectType Type
|
2021-05-14 14:07:19 +03:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2021-05-16 04:12:47 +03:00
|
|
|
|
if (XraySettings != null) return ProjectType.Xray;
|
|
|
|
|
return ProjectType.TrojanGo;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-05-14 14:07:19 +03:00
|
|
|
|
}
|
|
|
|
|
}
|