From 5d8b29664c13e6e5c6292d79973980182ece1441 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 13 Jan 2026 08:22:09 +0800 Subject: Add data loading from wrapper to view model --- CommandLineWrapper/JsonResults/Implements/AccountListResult.cs | 5 ++--- CommandLineWrapper/JsonResults/Implements/HereResult.cs | 8 +++++--- CommandLineWrapper/JsonResults/Implements/InfoResult.cs | 6 ++++-- CommandLineWrapper/JsonResults/Implements/ShareListResult.cs | 5 ++--- CommandLineWrapper/JsonResults/Implements/ShareSeeResult.cs | 7 +++++-- .../JsonResults/Implements/SheetAlignTasksResult.cs | 9 ++++----- CommandLineWrapper/JsonResults/Implements/SheetListResult.cs | 5 ++--- CommandLineWrapper/JsonResults/Implements/StatusResult.cs | 3 +-- CommandLineWrapper/JsonResults/JsonResultGetter.cs | 4 +--- 9 files changed, 26 insertions(+), 26 deletions(-) (limited to 'CommandLineWrapper/JsonResults') diff --git a/CommandLineWrapper/JsonResults/Implements/AccountListResult.cs b/CommandLineWrapper/JsonResults/Implements/AccountListResult.cs index 600b839..c6242ff 100644 --- a/CommandLineWrapper/JsonResults/Implements/AccountListResult.cs +++ b/CommandLineWrapper/JsonResults/Implements/AccountListResult.cs @@ -1,5 +1,4 @@ -using CommandLineWrapper; -using CommandLineWrapper.JsonResults; +namespace CommandLineWrapper.JsonResults.Implements; public class AccountListResultGetter : JsonResultGetter { @@ -15,4 +14,4 @@ public struct AccountListResult public struct AccountItem { public bool HasPrivateKey { get; set; } -} +} \ No newline at end of file diff --git a/CommandLineWrapper/JsonResults/Implements/HereResult.cs b/CommandLineWrapper/JsonResults/Implements/HereResult.cs index b3086a1..497d6c2 100644 --- a/CommandLineWrapper/JsonResults/Implements/HereResult.cs +++ b/CommandLineWrapper/JsonResults/Implements/HereResult.cs @@ -1,5 +1,4 @@ -using CommandLineWrapper; -using CommandLineWrapper.JsonResults; +namespace CommandLineWrapper.JsonResults.Implements; public class HereResultGetter : JsonResultGetter { @@ -8,6 +7,9 @@ public class HereResultGetter : JsonResultGetter public HereResultGetter(DirectoryInfo currentDirectory) => _currentDirectory = currentDirectory; + public void ChangeDirectory(DirectoryInfo directory) + => _currentDirectory = directory; + protected override Task ExecCommand(JVCSWorkspace workspace) => JVCSCommandInvoker.Invoke(Constants.CommandParameterGenerator.Here(), _currentDirectory.ToString()); } @@ -27,4 +29,4 @@ public struct HereResultItem public bool Exist { get; set; } public bool Modified { get; set; } public string Holder { get; set; } -} +} \ No newline at end of file diff --git a/CommandLineWrapper/JsonResults/Implements/InfoResult.cs b/CommandLineWrapper/JsonResults/Implements/InfoResult.cs index ecef724..1a3d11e 100644 --- a/CommandLineWrapper/JsonResults/Implements/InfoResult.cs +++ b/CommandLineWrapper/JsonResults/Implements/InfoResult.cs @@ -1,5 +1,4 @@ -using CommandLineWrapper; -using CommandLineWrapper.JsonResults; +namespace CommandLineWrapper.JsonResults.Implements; public class InfoResultGetter : JsonResultGetter { @@ -8,6 +7,9 @@ public class InfoResultGetter : JsonResultGetter public InfoResultGetter(string mappingName) => _mappingName = mappingName; + public void ChangeMappingName(string mappingName) + => _mappingName = mappingName; + protected override Task ExecCommand(JVCSWorkspace workspace) => workspace.Info(_mappingName); } diff --git a/CommandLineWrapper/JsonResults/Implements/ShareListResult.cs b/CommandLineWrapper/JsonResults/Implements/ShareListResult.cs index 4736b81..f309f8c 100644 --- a/CommandLineWrapper/JsonResults/Implements/ShareListResult.cs +++ b/CommandLineWrapper/JsonResults/Implements/ShareListResult.cs @@ -1,5 +1,4 @@ -using CommandLineWrapper; -using CommandLineWrapper.JsonResults; +namespace CommandLineWrapper.JsonResults.Implements; public class ShareListResultGetter : JsonResultGetter { @@ -18,4 +17,4 @@ public struct ShareItem public string Sharer { get; set; } public string Description { get; set; } public int FileCount { get; set; } -} +} \ No newline at end of file diff --git a/CommandLineWrapper/JsonResults/Implements/ShareSeeResult.cs b/CommandLineWrapper/JsonResults/Implements/ShareSeeResult.cs index c965b25..0fc63ee 100644 --- a/CommandLineWrapper/JsonResults/Implements/ShareSeeResult.cs +++ b/CommandLineWrapper/JsonResults/Implements/ShareSeeResult.cs @@ -1,7 +1,7 @@ -using CommandLineWrapper; -using CommandLineWrapper.JsonResults; using System.Text.Json.Serialization; +namespace CommandLineWrapper.JsonResults.Implements; + public class ShareSeeResultGetter : JsonResultGetter { private string _shareId; @@ -9,6 +9,9 @@ public class ShareSeeResultGetter : JsonResultGetter public ShareSeeResultGetter(string shareId) => _shareId = shareId; + public void ChangeShareId(string shareId) + => _shareId = shareId; + protected override Task ExecCommand(JVCSWorkspace workspace) => workspace.ShareSee(_shareId); } diff --git a/CommandLineWrapper/JsonResults/Implements/SheetAlignTasksResult.cs b/CommandLineWrapper/JsonResults/Implements/SheetAlignTasksResult.cs index 5539d19..60d07f3 100644 --- a/CommandLineWrapper/JsonResults/Implements/SheetAlignTasksResult.cs +++ b/CommandLineWrapper/JsonResults/Implements/SheetAlignTasksResult.cs @@ -1,13 +1,12 @@ -using CommandLineWrapper; -using CommandLineWrapper.JsonResults; +namespace CommandLineWrapper.JsonResults.Implements; -public class SheetAlignTasksResultGetter : JsonResultGetter +public class SheetAlignTasksResultGetter : JsonResultGetter { protected override Task ExecCommand(JVCSWorkspace workspace) => workspace.SheetAlignList(); } -public struct AlignJsonResult +public struct AlignResult { public Dictionary AlignTasks { get; set; } } @@ -16,4 +15,4 @@ public struct AlignTaskMapping { public string LocalMapping { get; set; } public string RemoteMapping { get; set; } -} +} \ No newline at end of file diff --git a/CommandLineWrapper/JsonResults/Implements/SheetListResult.cs b/CommandLineWrapper/JsonResults/Implements/SheetListResult.cs index 1fa9f0b..eb1068d 100644 --- a/CommandLineWrapper/JsonResults/Implements/SheetListResult.cs +++ b/CommandLineWrapper/JsonResults/Implements/SheetListResult.cs @@ -1,5 +1,4 @@ -using CommandLineWrapper; -using CommandLineWrapper.JsonResults; +namespace CommandLineWrapper.JsonResults.Implements; public class SheetListResultGetter : JsonResultGetter { @@ -23,4 +22,4 @@ public struct SheetItem { public string Name { get; set; } public string Holder { get; set; } -} +} \ No newline at end of file diff --git a/CommandLineWrapper/JsonResults/Implements/StatusResult.cs b/CommandLineWrapper/JsonResults/Implements/StatusResult.cs index aba2c25..6b52731 100644 --- a/CommandLineWrapper/JsonResults/Implements/StatusResult.cs +++ b/CommandLineWrapper/JsonResults/Implements/StatusResult.cs @@ -1,5 +1,4 @@ -using CommandLineWrapper; -using CommandLineWrapper.JsonResults; +namespace CommandLineWrapper.JsonResults.Implements; public class StatusResultGetter : JsonResultGetter { diff --git a/CommandLineWrapper/JsonResults/JsonResultGetter.cs b/CommandLineWrapper/JsonResults/JsonResultGetter.cs index e1bf607..2afd10c 100644 --- a/CommandLineWrapper/JsonResults/JsonResultGetter.cs +++ b/CommandLineWrapper/JsonResults/JsonResultGetter.cs @@ -1,10 +1,8 @@ -using static JVCSCommandInvoker; - namespace CommandLineWrapper.JsonResults { public abstract class JsonResultGetter { - protected abstract Task ExecCommand(JVCSWorkspace workspace); + protected abstract Task ExecCommand(JVCSWorkspace workspace); public async Task Get(JVCSWorkspace workspace) { -- cgit