mirror of
https://github.com/2dust/v2rayN.git
synced 2026-09-26 16:42:08 +03:00
Refactor code
Renamed FileManager to FileUtils and updated all references accordingly. Moved SemanticVersion to the Models namespace. Replaced WindowsJob with WindowsJobService, relocating and updating the implementation. Updated usages in CoreManager and related classes to use the new service and utility names. These changes improve code organization and naming consistency.
This commit is contained in:
@@ -119,7 +119,7 @@ public class BackupAndRestoreViewModel : MyReactiveObject
|
||||
return;
|
||||
}
|
||||
//check
|
||||
var lstFiles = FileManager.GetFilesFromZip(fileName);
|
||||
var lstFiles = FileUtils.GetFilesFromZip(fileName);
|
||||
if (lstFiles is null || !lstFiles.Any(t => t.Contains(_guiConfigs)))
|
||||
{
|
||||
DisplayOperationMsg(ResUI.LocalRestoreInvalidZipTips);
|
||||
@@ -135,7 +135,7 @@ public class BackupAndRestoreViewModel : MyReactiveObject
|
||||
await SQLiteHelper.Instance.DisposeDbConnectionAsync();
|
||||
|
||||
var toPath = Utils.GetConfigPath();
|
||||
FileManager.ZipExtractToFile(fileName, toPath, "");
|
||||
FileUtils.ZipExtractToFile(fileName, toPath, "");
|
||||
|
||||
if (Utils.IsWindows())
|
||||
{
|
||||
@@ -167,8 +167,8 @@ public class BackupAndRestoreViewModel : MyReactiveObject
|
||||
var configDirZipTemp = Utils.GetTempPath($"v2rayN_{DateTime.Now:yyyyMMddHHmmss}");
|
||||
var configDirTemp = Path.Combine(configDirZipTemp, _guiConfigs);
|
||||
|
||||
FileManager.CopyDirectory(configDir, configDirTemp, false, true, "");
|
||||
var ret = FileManager.CreateFromDirectory(configDirZipTemp, fileName);
|
||||
FileUtils.CopyDirectory(configDir, configDirTemp, false, true, "");
|
||||
var ret = FileUtils.CreateFromDirectory(configDirZipTemp, fileName);
|
||||
Directory.Delete(configDirZipTemp, true);
|
||||
return await Task.FromResult(ret);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user