Skip to content

Commit f7aecde

Browse files
committed
Merge branch 'VEX-88_v1.86' into main
2 parents baee96b + 127060d commit f7aecde

File tree

102 files changed

+336
-949
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+336
-949
lines changed

LegacyUpdateUtil/App.xaml.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Configuration;
4-
using System.Data;
5-
using System.Linq;
6-
using System.Threading.Tasks;
7-
using System.Windows;
1+
using System.Windows;
82

93
namespace LegacyUpdateUtil
104
{

LegacyUpdateUtil/Core/CalcUtil.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
62

73
namespace LegacyUpdateUtil.Core
84
{

LegacyUpdateUtil/Core/Constants.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
62

73
namespace LegacyUpdateUtil.Core
84
{

LegacyUpdateUtil/Core/ObservableObject.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.ComponentModel;
4-
using System.Linq;
1+
using System.ComponentModel;
52
using System.Runtime.CompilerServices;
6-
using System.Text;
7-
using System.Threading.Tasks;
83

94
namespace LegacyUpdateUtil.Core
105
{

LegacyUpdateUtil/Core/Update.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System.Linq;
99
using System.Net.Http;
1010
using System.Net.Http.Headers;
11-
using System.Text;
1211
using System.Threading.Tasks;
1312
using System.Windows;
1413

@@ -46,7 +45,7 @@ public static async Task DownloadUpdate(string packageFile, string updaterFile,
4645
startTime = DateTimeOffset.Now;
4746

4847
i = 0;
49-
for(int len = packageStream.Read(buffer, 0, 1024 * 1024); len != 0; len = packageStream.Read(buffer, 0, 1024 * 1024))
48+
for (int len = packageStream.Read(buffer, 0, 1024 * 1024); len != 0; len = packageStream.Read(buffer, 0, 1024 * 1024))
5049
{
5150

5251
packageTotalBytesRead += len;
@@ -85,7 +84,7 @@ public static async Task DownloadUpdate(string packageFile, string updaterFile,
8584
double updaterProgress = CalcUtil.CalcProgress(updaterContentLength, updaterTotalBytesRead);
8685
MainVM.SetUpdaterData(updaterContentLength, updaterTotalBytesRead, updaterProgress);
8786

88-
if(i % 15 == 0)
87+
if (i % 15 == 0)
8988
{
9089
double downloadSpeed = updaterTotalBytesRead / (DateTimeOffset.Now - startTime).TotalSeconds;
9190
MainVM.SetDownloadSpeed(downloadSpeed);
@@ -124,15 +123,15 @@ public static (double, string) FormatSize(double rawSize, bool isSpeed = false)
124123
if (isSpeed) unit = " B/s";
125124

126125
int divisions = 0;
127-
while(size > 1)
126+
while (size > 1)
128127
{
129128
size /= 1024;
130129
divisions++;
131130

132131
if (divisions > 3) break;
133132
}
134133

135-
if(divisions > 0)
134+
if (divisions > 0)
136135
{
137136
size *= 1024;
138137
divisions--;
@@ -159,7 +158,7 @@ public static class UpdateHelper
159158

160159
public static async void CheckUpdateAsync(bool forceUpdate = false)
161160
{
162-
if(Directory.Exists(Constants.UpdateFolder)) Directory.Delete(Constants.UpdateFolder, true);
161+
if (Directory.Exists(Constants.UpdateFolder)) Directory.Delete(Constants.UpdateFolder, true);
163162

164163
HttpRequestMessage request = new HttpRequestMessage() { RequestUri = new Uri(Constants.ReleasesURL), Method = HttpMethod.Get };
165164
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
@@ -169,7 +168,7 @@ public static async void CheckUpdateAsync(bool forceUpdate = false)
169168
string res = await response.Content.ReadAsStringAsync();
170169

171170
JArray ja = JArray.Parse(res);
172-
foreach(JObject release in ja)
171+
foreach (JObject release in ja)
173172
{
174173
List<string> tokenizedName = release["name"].ToString().Split().ToList();
175174
if (tokenizedName[0] != Constants.AppName) continue;
@@ -189,7 +188,7 @@ public static async void CheckUpdateAsync(bool forceUpdate = false)
189188

190189
public static async void GetUpdate()
191190
{
192-
if(!Directory.Exists(Constants.UpdateFolder)) Directory.CreateDirectory(Constants.UpdateFolder);
191+
if (!Directory.Exists(Constants.UpdateFolder)) Directory.CreateDirectory(Constants.UpdateFolder);
193192

194193
await UpdateUtil.DownloadUpdate(SourceFile, UpdaterFile, latestVersionTag, client);
195194
UpdateUtil.ExtractUpdate(SourceFile, ExtractTarget);

LegacyUpdateUtil/MVVM/Converter/AngleToIsLargeConverter.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.Globalization;
4-
using System.Linq;
5-
using System.Text;
6-
using System.Threading.Tasks;
73
using System.Windows.Data;
84

95
namespace LegacyUpdateUtil.MVVM.Converter

LegacyUpdateUtil/MVVM/Model/ProgressArcModel.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
62
using System.Windows;
73
using System.Windows.Controls;
8-
using System.Windows.Data;
9-
using System.Windows.Documents;
10-
using System.Windows.Input;
114
using System.Windows.Media;
12-
using System.Windows.Media.Imaging;
13-
using System.Windows.Navigation;
14-
using System.Windows.Shapes;
155

166
namespace LegacyUpdateUtil.MVVM.Model
177
{
@@ -59,7 +49,7 @@ public Point BackgroundOrigin
5949
get => (Point)GetValue(BackgroundOriginProperty);
6050
set => SetValue(BackgroundOriginProperty, value);
6151
}
62-
52+
6353
public Point BackgroundStartPoint
6454
{
6555
get => (Point)GetValue(BackgroundStartPointProperty);
@@ -134,7 +124,7 @@ public double Value
134124
get => (double)GetValue(ValueProperty);
135125
set => SetValue(ValueProperty, value);
136126
}
137-
127+
138128
public string Symbol
139129
{
140130
get => (string)GetValue(SymbolProperty);

LegacyUpdateUtil/MVVM/Model/TextWithUnit.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
using System.Windows;
1+
using System.Windows;
72
using System.Windows.Controls;
8-
using System.Windows.Data;
9-
using System.Windows.Documents;
10-
using System.Windows.Input;
11-
using System.Windows.Media;
12-
using System.Windows.Media.Imaging;
13-
using System.Windows.Navigation;
14-
using System.Windows.Shapes;
153

164
namespace LegacyUpdateUtil.MVVM.Model
175
{

LegacyUpdateUtil/MVVM/ViewModel/MainViewModel.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using LegacyUpdateUtil.Core;
32
using System.IO;
4-
using System.Linq;
5-
using System.Text;
6-
using System.Threading;
7-
using System.Threading.Tasks;
8-
using LegacyUpdateUtil.Core;
93

104
namespace LegacyUpdateUtil.MVVM.ViewModel
115
{
@@ -162,12 +156,12 @@ public void SetUpdaterData(long total, long size, double progress)
162156

163157
public MainViewModel()
164158
{
165-
if(Directory.Exists(Constants.LegacyDataFolder))
159+
if (Directory.Exists(Constants.LegacyDataFolder))
166160
{
167161
DirectoryInfo targetDir = new DirectoryInfo(Constants.DataFolder);
168-
if(!targetDir.Exists) Directory.CreateDirectory(Constants.DataFolder);
162+
if (!targetDir.Exists) Directory.CreateDirectory(Constants.DataFolder);
169163

170-
foreach(string f in Directory.GetFiles(Constants.LegacyDataFolder))
164+
foreach (string f in Directory.GetFiles(Constants.LegacyDataFolder))
171165
{
172166
FileInfo file = new FileInfo(f);
173167
file.MoveTo(targetDir + "\\" + file.Name);

LegacyUpdateUtil/MVVM/ViewModel/ViewModelManager.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
1+
using System.Collections.Generic;
62

73
namespace LegacyUpdateUtil.MVVM.ViewModel
84
{

0 commit comments

Comments
 (0)