Skip to content

Commit dedd6f5

Browse files
committed
The WinGetSource class now contains the identifier
1 parent fbde6a5 commit dedd6f5

2 files changed

Lines changed: 247 additions & 30 deletions

File tree

src/WGet.NET/Models/WinGetSource.cs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,31 @@ public string SourceData
105105
}
106106
}
107107
}
108+
/// <summary>
109+
/// Gets or sets the identifier of the source.
110+
/// </summary>
111+
/// <remarks>
112+
/// Will only be set on source export.
113+
/// </remarks>
114+
[JsonPropertyName("Identifier")]
115+
public string SourceIdentifier
116+
{
117+
get
118+
{
119+
return _sourceIdentifier;
120+
}
121+
set
122+
{
123+
if (value is null)
124+
{
125+
_sourceIdentifier = string.Empty;
126+
}
127+
else
128+
{
129+
_sourceIdentifier = value;
130+
}
131+
}
132+
}
108133

109134
/// <summary>
110135
/// Gets if the object is empty.
@@ -114,7 +139,7 @@ public bool IsEmpty
114139
{
115140
get
116141
{
117-
if ((_sourceName.Length + _sourceUrl.Length + _sourceType.Length + _sourceData.Length) > 0)
142+
if ((_sourceName.Length + _sourceUrl.Length + _sourceType.Length + _sourceData.Length + _sourceIdentifier.Length) > 0)
118143
{
119144
return false;
120145
}
@@ -126,5 +151,6 @@ public bool IsEmpty
126151
private string _sourceUrl = string.Empty;
127152
private string _sourceType = string.Empty;
128153
private string _sourceData = string.Empty;
154+
private string _sourceIdentifier = string.Empty;
129155
}
130156
}

0 commit comments

Comments
 (0)