99using GeneralUpdate . PacketTool . Services ;
1010using GeneralUpdate . Zip . Factory ;
1111using Newtonsoft . Json ;
12- using System . Net . Http . Json ;
1312using System . Text ;
1413
1514namespace GeneralUpdate . PacketTool . ViewModels
@@ -76,9 +75,11 @@ public List<string> AppTypes
7675 {
7776 if ( _appTypes == null )
7877 {
79- _appTypes = new List < string > ( ) ;
80- _appTypes . Add ( "Client" ) ;
81- _appTypes . Add ( "Upgrade" ) ;
78+ _appTypes = new List < string >
79+ {
80+ "Client" ,
81+ "Upgrade"
82+ } ;
8283 }
8384 return _appTypes ;
8485 }
@@ -90,8 +91,10 @@ public List<string> Formats
9091 {
9192 if ( _formats == null )
9293 {
93- _formats = new List < string > ( ) ;
94- _formats . Add ( ".zip" ) ;
94+ _formats = new List < string >
95+ {
96+ ".zip"
97+ } ;
9598 //_formats.Add(".7z");
9699 }
97100 return _formats ;
@@ -244,13 +247,22 @@ private async Task BuildJsonCallback()
244247 }
245248 string path = Path . Combine ( pickerResult , _jsonTemplateFileName ) ;
246249 if ( File . Exists ( path ) ) await Shell . Current . DisplayAlert ( "Build options" , "File already exists !" , "check" ) ;
247- var jsonObj = new List < VersionTmplateModel > ( ) ;
248- jsonObj . Add ( new VersionTmplateModel ( ) { } ) ;
249- jsonObj . Add ( new VersionTmplateModel ( ) { } ) ;
250- jsonObj . Add ( new VersionTmplateModel ( ) { } ) ;
250+ var jsonObj = new List < VersionTmplateModel >
251+ {
252+ new VersionTmplateModel ( ) ,
253+ new VersionTmplateModel ( ) ,
254+ new VersionTmplateModel ( )
255+ } ;
251256 await BuildVersionTemplate ( path , jsonObj ) ;
252257 }
253258
259+ /// <summary>
260+ /// Generate a version information file template.
261+ /// </summary>
262+ /// <typeparam name="T"></typeparam>
263+ /// <param name="path">Generate file path.</param>
264+ /// <param name="content">Generate file content.</param>
265+ /// <returns></returns>
254266 private async Task BuildVersionTemplate < T > ( string path , T content ) where T : class
255267 {
256268 string json = JsonConvert . SerializeObject ( content ) ;
0 commit comments