WGet.NET 4.4.1
A WinGet wrapper library for .Net.
Loading...
Searching...
No Matches
SourceModel.cs
1//--------------------------------------------------//
2// Created by basicx-StrgV //
3// https://github.com/basicx-StrgV/ //
4//--------------------------------------------------//
5using System.Collections.Generic;
6
7namespace WGetNET.Models
8{
12 internal class SourceModel
13 {
17 public string Name
18 {
19 get
20 {
21 return _name;
22 }
23 set
24 {
25 if (value != null)
26 {
27 _name = value;
28 }
29 else
30 {
31 _name = string.Empty;
32 }
33 }
34 }
35
39 public string Arg
40 {
41 get
42 {
43 return _arg;
44 }
45 set
46 {
47 if (value != null)
48 {
49 _arg = value;
50 }
51 else
52 {
53 _arg = string.Empty;
54 }
55 }
56 }
57
61 public string Type
62 {
63 get
64 {
65 return _type;
66 }
67 set
68 {
69 if (value != null)
70 {
71 _type = value;
72 }
73 else
74 {
75 _type = string.Empty;
76 }
77 }
78 }
79
83 public string Data
84 {
85 get
86 {
87 return _data;
88 }
89 set
90 {
91 if (value != null)
92 {
93 _data = value;
94 }
95 else
96 {
97 _data = string.Empty;
98 }
99 }
100 }
101
105 public string Identifier
106 {
107 get
108 {
109 return _identifier;
110 }
111 set
112 {
113 if (value != null)
114 {
115 _identifier = value;
116 }
117 else
118 {
119 _identifier = string.Empty;
120 }
121 }
122 }
123
127 public bool Explicit { get; set; }
128
132 public List<string> TrustLevel
133 {
134 get
135 {
136 return _trustLevel;
137 }
138 set
139 {
140 if (value != null)
141 {
142 _trustLevel = value;
143 }
144 else
145 {
146 _trustLevel = new List<string>();
147 }
148 }
149 }
150
151 private string _name = string.Empty;
152 private string _arg = string.Empty;
153 private string _type = string.Empty;
154 private string _data = string.Empty;
155 private string _identifier = string.Empty;
156 private List<string> _trustLevel = new List<string>();
157
161 public SourceModel()
162 {
163 // Empty constructor for JSON parsing.
164 }
165
173 public static SourceModel FromWinGetSource(WinGetSource source)
174 {
175 return new SourceModel()
176 {
177 Name = source.Name,
178 Arg = source.Arg,
179 Type = source.Type,
180 Data = source.Data,
181 Identifier = source.Identifier,
182 Explicit = source.Explicit,
183 TrustLevel = source.TrustLevel
184 };
185 }
186 }
187}