Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9b1aaa5

Browse files
committed
Move types around
1 parent01e7e6d commit9b1aaa5

File tree

3 files changed

+54
-54
lines changed

3 files changed

+54
-54
lines changed

‎App/Services/MutagenController.cs

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,50 +23,50 @@
2323

2424
namespaceCoder.Desktop.App.Services;
2525

26-
publicenumCreateSyncSessionRequestEndpointProtocol
27-
{
28-
Local,
29-
Ssh,
30-
}
31-
32-
publicclassCreateSyncSessionRequestEndpoint
26+
publicclassCreateSyncSessionRequest
3327
{
34-
publicrequiredCreateSyncSessionRequestEndpointProtocolProtocol{get;init;}
35-
publicstringUser{get;init;}="";
36-
publicstringHost{get;init;}="";
37-
publicuintPort{get;init;}=0;
38-
publicstringPath{get;init;}="";
28+
publicrequiredEndpointAlpha{get;init;}
29+
publicrequiredEndpointBeta{get;init;}
3930

40-
publicURLMutagenUrl
31+
publicclassEndpoint
4132
{
42-
get
33+
publicenumProtocolKind
4334
{
44-
varprotocol=Protocolswitch
45-
{
46-
CreateSyncSessionRequestEndpointProtocol.Local=>MutagenProtocol.Local,
47-
CreateSyncSessionRequestEndpointProtocol.Ssh=>MutagenProtocol.Ssh,
48-
_=>thrownewArgumentException($"Invalid protocol '{Protocol}'",nameof(Protocol)),
49-
};
35+
Local,
36+
Ssh,
37+
}
5038

51-
returnnewURL
39+
publicrequiredProtocolKindProtocol{get;init;}
40+
publicstringUser{get;init;}="";
41+
publicstringHost{get;init;}="";
42+
publicuintPort{get;init;}=0;
43+
publicstringPath{get;init;}="";
44+
45+
publicURLMutagenUrl
46+
{
47+
get
5248
{
53-
Kind=Kind.Synchronization,
54-
Protocol=protocol,
55-
User=User,
56-
Host=Host,
57-
Port=Port,
58-
Path=Path,
59-
};
49+
varprotocol=Protocolswitch
50+
{
51+
ProtocolKind.Local=>MutagenProtocol.Local,
52+
ProtocolKind.Ssh=>MutagenProtocol.Ssh,
53+
_=>thrownewArgumentException($"Invalid protocol '{Protocol}'",nameof(Protocol)),
54+
};
55+
56+
returnnewURL
57+
{
58+
Kind=Kind.Synchronization,
59+
Protocol=protocol,
60+
User=User,
61+
Host=Host,
62+
Port=Port,
63+
Path=Path,
64+
};
65+
}
6066
}
6167
}
6268
}
6369

64-
publicclassCreateSyncSessionRequest
65-
{
66-
publicrequiredCreateSyncSessionRequestEndpointAlpha{get;init;}
67-
publicrequiredCreateSyncSessionRequestEndpointBeta{get;init;}
68-
}
69-
7070
publicinterfaceISyncSessionController:IAsyncDisposable
7171
{
7272
Task<IEnumerable<SyncSessionModel>>ListSyncSessions(CancellationTokenct=default);

‎App/ViewModels/FileSyncListViewModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,14 @@ private async Task ConfirmNewSession()
250250
{
251251
await_syncSessionController.CreateSyncSession(newCreateSyncSessionRequest
252252
{
253-
Alpha=newCreateSyncSessionRequestEndpoint
253+
Alpha=newCreateSyncSessionRequest.Endpoint
254254
{
255-
Protocol=CreateSyncSessionRequestEndpointProtocol.Local,
255+
Protocol=CreateSyncSessionRequest.Endpoint.ProtocolKind.Local,
256256
Path=NewSessionLocalPath,
257257
},
258-
Beta=newCreateSyncSessionRequestEndpoint
258+
Beta=newCreateSyncSessionRequest.Endpoint
259259
{
260-
Protocol=CreateSyncSessionRequestEndpointProtocol.Ssh,
260+
Protocol=CreateSyncSessionRequest.Endpoint.ProtocolKind.Ssh,
261261
Host=NewSessionRemoteHost,
262262
Path=NewSessionRemotePath,
263263
},

‎Tests.App/Services/MutagenControllerTest.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ public async Task Ok(CancellationToken ct)
101101

102102
varsession1=awaitcontroller.CreateSyncSession(newCreateSyncSessionRequest
103103
{
104-
Alpha=newCreateSyncSessionRequestEndpoint
104+
Alpha=newCreateSyncSessionRequest.Endpoint
105105
{
106-
Protocol=CreateSyncSessionRequestEndpointProtocol.Local,
106+
Protocol=CreateSyncSessionRequest.Endpoint.ProtocolKind.Local,
107107
Path=alphaDirectory.FullName,
108108
},
109-
Beta=newCreateSyncSessionRequestEndpoint
109+
Beta=newCreateSyncSessionRequest.Endpoint
110110
{
111-
Protocol=CreateSyncSessionRequestEndpointProtocol.Local,
111+
Protocol=CreateSyncSessionRequest.Endpoint.ProtocolKind.Local,
112112
Path=betaDirectory.FullName,
113113
},
114114
},ct);
@@ -119,14 +119,14 @@ public async Task Ok(CancellationToken ct)
119119

120120
varsession2=awaitcontroller.CreateSyncSession(newCreateSyncSessionRequest
121121
{
122-
Alpha=newCreateSyncSessionRequestEndpoint
122+
Alpha=newCreateSyncSessionRequest.Endpoint
123123
{
124-
Protocol=CreateSyncSessionRequestEndpointProtocol.Local,
124+
Protocol=CreateSyncSessionRequest.Endpoint.ProtocolKind.Local,
125125
Path=alphaDirectory.FullName,
126126
},
127-
Beta=newCreateSyncSessionRequestEndpoint
127+
Beta=newCreateSyncSessionRequest.Endpoint
128128
{
129-
Protocol=CreateSyncSessionRequestEndpointProtocol.Local,
129+
Protocol=CreateSyncSessionRequest.Endpoint.ProtocolKind.Local,
130130
Path=betaDirectory.FullName,
131131
},
132132
},ct);
@@ -199,14 +199,14 @@ public async Task CreateRestartsDaemon(CancellationToken ct)
199199
awaitcontroller.Initialize(ct);
200200
awaitcontroller.CreateSyncSession(newCreateSyncSessionRequest
201201
{
202-
Alpha=newCreateSyncSessionRequestEndpoint
202+
Alpha=newCreateSyncSessionRequest.Endpoint
203203
{
204-
Protocol=CreateSyncSessionRequestEndpointProtocol.Local,
204+
Protocol=CreateSyncSessionRequest.Endpoint.ProtocolKind.Local,
205205
Path=alphaDirectory.FullName,
206206
},
207-
Beta=newCreateSyncSessionRequestEndpoint
207+
Beta=newCreateSyncSessionRequest.Endpoint
208208
{
209-
Protocol=CreateSyncSessionRequestEndpointProtocol.Local,
209+
Protocol=CreateSyncSessionRequest.Endpoint.ProtocolKind.Local,
210210
Path=betaDirectory.FullName,
211211
},
212212
},ct);
@@ -239,14 +239,14 @@ public async Task Orphaned(CancellationToken ct)
239239
awaitcontroller1.Initialize(ct);
240240
awaitcontroller1.CreateSyncSession(newCreateSyncSessionRequest
241241
{
242-
Alpha=newCreateSyncSessionRequestEndpoint
242+
Alpha=newCreateSyncSessionRequest.Endpoint
243243
{
244-
Protocol=CreateSyncSessionRequestEndpointProtocol.Local,
244+
Protocol=CreateSyncSessionRequest.Endpoint.ProtocolKind.Local,
245245
Path=alphaDirectory.FullName,
246246
},
247-
Beta=newCreateSyncSessionRequestEndpoint
247+
Beta=newCreateSyncSessionRequest.Endpoint
248248
{
249-
Protocol=CreateSyncSessionRequestEndpointProtocol.Local,
249+
Protocol=CreateSyncSessionRequest.Endpoint.ProtocolKind.Local,
250250
Path=betaDirectory.FullName,
251251
},
252252
},ct);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp