File tree Expand file tree Collapse file tree 2 files changed +12
-23
lines changed
Flow.Launcher.Infrastructure Expand file tree Collapse file tree 2 files changed +12
-23
lines changed Original file line number Diff line number Diff line change 17
17
using Flow . Launcher . Plugin ;
18
18
using System . Text . Json . Serialization ;
19
19
using System . Threading ;
20
+ using System . Text . Json ;
20
21
21
22
namespace Flow . Launcher . Core
22
23
{
@@ -51,7 +52,7 @@ public async Task UpdateAppAsync(bool silentUpdate = true)
51
52
var newReleaseVersion = Version . Parse ( newUpdateInfo . FutureReleaseEntry . Version . ToString ( ) ) ;
52
53
var currentVersion = Version . Parse ( Constant . Version ) ;
53
54
54
- Log . Info ( $ "|Updater.UpdateApp|Future Release <{ newUpdateInfo . FutureReleaseEntry . Formatted ( ) } >") ;
55
+ Log . Info ( $ "|Updater.UpdateApp|Future Release <{ Formatted ( newUpdateInfo . FutureReleaseEntry ) } >") ;
55
56
56
57
if ( newReleaseVersion <= currentVersion )
57
58
{
@@ -151,5 +152,15 @@ public string NewVersionTips(string version)
151
152
152
153
return tips ;
153
154
}
155
+
156
+ private static string Formatted < T > ( T t )
157
+ {
158
+ var formatted = JsonSerializer . Serialize ( t , new JsonSerializerOptions
159
+ {
160
+ WriteIndented = true
161
+ } ) ;
162
+
163
+ return formatted ;
164
+ }
154
165
}
155
166
}
Original file line number Diff line number Diff line change 2
2
3
3
using System ;
4
4
using System . IO ;
5
- using System . Text . Json ;
6
- using System . Text . Json . Serialization ;
7
5
8
6
namespace Flow . Launcher . Infrastructure
9
7
{
10
8
public static class Helper
11
9
{
12
- static Helper ( )
13
- {
14
- jsonFormattedSerializerOptions . Converters . Add ( new JsonStringEnumConverter ( ) ) ;
15
- }
16
-
17
10
/// <summary>
18
11
/// http://www.yinwang.org/blog-cn/2015/11/21/programming-philosophy
19
12
/// </summary>
@@ -71,20 +64,5 @@ public static void ValidateDirectory(string path)
71
64
Directory . CreateDirectory ( path ) ;
72
65
}
73
66
}
74
-
75
- private static readonly JsonSerializerOptions jsonFormattedSerializerOptions = new JsonSerializerOptions
76
- {
77
- WriteIndented = true
78
- } ;
79
-
80
- public static string Formatted < T > ( this T t )
81
- {
82
- var formatted = JsonSerializer . Serialize ( t , new JsonSerializerOptions
83
- {
84
- WriteIndented = true
85
- } ) ;
86
-
87
- return formatted ;
88
- }
89
67
}
90
68
}
You can’t perform that action at this time.
0 commit comments