mirror of
https://github.com/2dust/v2rayN.git
synced 2026-02-28 13:13:04 +00:00
Refactor
This commit is contained in:
parent
274fc8084d
commit
323bf70474
1 changed files with 11 additions and 7 deletions
|
|
@ -3,6 +3,8 @@ namespace ServiceLib.Models;
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ProfileItem : ReactiveObject
|
public class ProfileItem : ReactiveObject
|
||||||
{
|
{
|
||||||
|
private ProtocolExtraItem _protocolExtraItem = new();
|
||||||
|
|
||||||
public ProfileItem()
|
public ProfileItem()
|
||||||
{
|
{
|
||||||
IndexId = string.Empty;
|
IndexId = string.Empty;
|
||||||
|
|
@ -127,16 +129,12 @@ public class ProfileItem : ReactiveObject
|
||||||
|
|
||||||
public void SetProtocolExtra(ProtocolExtraItem extraItem)
|
public void SetProtocolExtra(ProtocolExtraItem extraItem)
|
||||||
{
|
{
|
||||||
ProtoExtra = JsonUtils.Serialize(extraItem, false);
|
_protocolExtraItem = extraItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProtocolExtraItem GetProtocolExtra()
|
public ProtocolExtraItem GetProtocolExtra()
|
||||||
{
|
{
|
||||||
if (ProtoExtra.IsNullOrEmpty())
|
return _protocolExtraItem;
|
||||||
{
|
|
||||||
return new ProtocolExtraItem();
|
|
||||||
}
|
|
||||||
return JsonUtils.Deserialize<ProtocolExtraItem>(ProtoExtra);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion function
|
#endregion function
|
||||||
|
|
@ -174,7 +172,13 @@ public class ProfileItem : ReactiveObject
|
||||||
public string CertSha { get; set; }
|
public string CertSha { get; set; }
|
||||||
public string EchConfigList { get; set; }
|
public string EchConfigList { get; set; }
|
||||||
public string EchForceQuery { get; set; }
|
public string EchForceQuery { get; set; }
|
||||||
public string ProtoExtra { get; set; }
|
|
||||||
|
public string ProtoExtra
|
||||||
|
{
|
||||||
|
get => JsonUtils.Serialize(_protocolExtraItem, false);
|
||||||
|
set => _protocolExtraItem = JsonUtils.Deserialize<ProtocolExtraItem>(value);
|
||||||
|
}
|
||||||
|
|
||||||
[Obsolete("Use ProtocolExtraItem.Ports instead.")]
|
[Obsolete("Use ProtocolExtraItem.Ports instead.")]
|
||||||
public string Ports { get; set; }
|
public string Ports { get; set; }
|
||||||
[Obsolete("Use ProtocolExtraItem.AlterId instead.")]
|
[Obsolete("Use ProtocolExtraItem.AlterId instead.")]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue