Skip to content

Commit ae6460f

Browse files
authored
Cleanup code formatting and lint (#6)
* partial cleanup changes * Cleanup lint * Fix build error * Cleanup warnings * Remove unused code * Improve code style rules * Remove deleted file reference * Cleanup class
1 parent 873ab24 commit ae6460f

32 files changed

+455
-254
lines changed

.editorconfig

+48-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,54 @@ end_of_line = crlf
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

11-
[*.{csproj,config,nuspec,md,yml}]
11+
csharp_new_line_before_members_in_anonymous_types = false
12+
csharp_new_line_before_members_in_object_initializers = false
13+
csharp_preferred_modifier_order = public, private, protected, internal, new, abstract, virtual, sealed, override, static, readonly, extern, unsafe, volatile, async:suggestion
14+
csharp_space_after_cast = false
15+
csharp_style_var_elsewhere = true:hint
16+
csharp_style_var_for_built_in_types = true:hint
17+
csharp_style_var_when_type_is_apparent = true:hint
18+
19+
dotnet_style_predefined_type_for_locals_parameters_members = true:hint
20+
dotnet_style_predefined_type_for_member_access = true:hint
21+
dotnet_style_qualification_for_event = true:hint
22+
dotnet_style_qualification_for_field = true:hint
23+
dotnet_style_qualification_for_method = false:hint
24+
dotnet_style_qualification_for_property = true:hint
25+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:hint
26+
27+
resharper_blank_line_after_pi = false
28+
resharper_blank_lines_after_multiline_statements = 1
29+
resharper_braces_for_ifelse = required_for_multiline_statement
30+
resharper_braces_for_while = required_for_multiline
31+
resharper_csharp_empty_block_style = together_same_line
32+
resharper_csharp_insert_final_newline = true
33+
resharper_csharp_wrap_lines = false
34+
resharper_html_normalize_tag_names = true
35+
resharper_keep_existing_declaration_parens_arrangement = false
36+
resharper_keep_existing_embedded_arrangement = false
37+
resharper_keep_existing_expr_member_arrangement = false
38+
resharper_keep_existing_initializer_arrangement = false
39+
resharper_keep_existing_linebreaks = false
40+
resharper_keep_existing_switch_expression_arrangement = false
41+
resharper_local_function_body = expression_body
42+
resharper_max_enum_members_on_line = 1
43+
resharper_method_or_operator_body = expression_body
44+
resharper_no_indent_inside_elements =
45+
resharper_normalize_tag_names = true
46+
resharper_place_accessorholder_attribute_on_same_line = false
47+
resharper_place_expr_accessor_on_single_line = true
48+
resharper_place_expr_method_on_single_line = true
49+
resharper_place_expr_property_on_single_line = true
50+
resharper_place_field_attribute_on_same_line = false
51+
resharper_place_simple_embedded_statement_on_same_line = true
52+
resharper_space_after_cast = false
53+
resharper_space_within_single_line_array_initializer_braces = true
54+
resharper_wrap_array_initializer_style = chop_always
55+
resharper_wrap_object_and_collection_initializer_style = chop_always
56+
resharper_xmldoc_indent_text = zero_indent
57+
58+
[*.{csproj,config,nuspec,md,yml,lock}]
1259
indent_style = space
1360
indent_size = 2
1461

Commands/ICommandManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using JetBrains.Annotations;
21
using System;
32
using System.Collections.Generic;
3+
using JetBrains.Annotations;
44

55
namespace NFive.SDK.Client.Commands
66
{

Communications/ICommunicationManager.cs

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
using JetBrains.Annotations;
2+
13
namespace NFive.SDK.Client.Communications
24
{
5+
[PublicAPI]
36
public interface ICommunicationManager
47
{
58
ICommunicationTarget Event(string @event);

Events/ICommunicationMessage.cs Communications/ICommunicationMessage.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
namespace NFive.SDK.Client.Events
1+
using JetBrains.Annotations;
2+
3+
namespace NFive.SDK.Client.Communications
24
{
5+
[PublicAPI]
36
public interface ICommunicationMessage
47
{
58
/// <summary>
+78-1
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,111 @@
11
using System;
22
using JetBrains.Annotations;
3-
using NFive.SDK.Client.Events;
43

54
namespace NFive.SDK.Client.Communications
65
{
76
[PublicAPI]
87
public interface ICommunicationReceive
98
{
9+
/// <summary>
10+
/// Registers the specified callback.
11+
/// </summary>
12+
/// <param name="callback">The callback.</param>
1013
void On(Action<ICommunicationMessage> callback);
1114

15+
/// <summary>
16+
/// Registers the specified callback.
17+
/// </summary>
18+
/// <typeparam name="T">The type of the first callback parameter.</typeparam>
19+
/// <param name="callback">The callback.</param>
1220
void On<T>(Action<ICommunicationMessage, T> callback);
1321

22+
/// <summary>
23+
/// Registers the specified callback.
24+
/// </summary>
25+
/// <typeparam name="T1">The type of the first callback parameter.</typeparam>
26+
/// <typeparam name="T2">The type of the second callback parameter.</typeparam>
27+
/// <param name="callback">The callback.</param>
1428
void On<T1, T2>(Action<ICommunicationMessage, T1, T2> callback);
1529

30+
/// <summary>
31+
/// Registers the specified callback.
32+
/// </summary>
33+
/// <typeparam name="T1">The type of the first callback parameter.</typeparam>
34+
/// <typeparam name="T2">The type of the second callback parameter.</typeparam>
35+
/// <typeparam name="T3">The type of the third callback parameter.</typeparam>
36+
/// <param name="callback">The callback.</param>
1637
void On<T1, T2, T3>(Action<ICommunicationMessage, T1, T2, T3> callback);
1738

39+
/// <summary>
40+
/// Registers the specified callback.
41+
/// </summary>
42+
/// <typeparam name="T1">The type of the first callback parameter.</typeparam>
43+
/// <typeparam name="T2">The type of the second callback parameter.</typeparam>
44+
/// <typeparam name="T3">The type of the third callback parameter.</typeparam>
45+
/// <typeparam name="T4">The type of the fourth callback parameter.</typeparam>
46+
/// <param name="callback">The callback.</param>
1847
void On<T1, T2, T3, T4>(Action<ICommunicationMessage, T1, T2, T3, T4> callback);
1948

49+
/// <summary>
50+
/// Registers the specified callback.
51+
/// </summary>
52+
/// <typeparam name="T1">The type of the first callback parameter.</typeparam>
53+
/// <typeparam name="T2">The type of the second callback parameter.</typeparam>
54+
/// <typeparam name="T3">The type of the third callback parameter.</typeparam>
55+
/// <typeparam name="T4">The type of the fourth callback parameter.</typeparam>
56+
/// <typeparam name="T5">The type of the fifth callback parameter.</typeparam>
57+
/// <param name="callback">The callback.</param>
2058
void On<T1, T2, T3, T4, T5>(Action<ICommunicationMessage, T1, T2, T3, T4, T5> callback);
2159

60+
/// <summary>
61+
/// Registers the specified callback.
62+
/// </summary>
63+
/// <param name="callback">The callback.</param>
2264
void OnRequest(Action<ICommunicationMessage> callback);
2365

66+
/// <summary>
67+
/// Registers the specified callback.
68+
/// </summary>
69+
/// <typeparam name="T">The type of the first callback parameter.</typeparam>
70+
/// <param name="callback">The callback.</param>
2471
void OnRequest<T>(Action<ICommunicationMessage, T> callback);
2572

73+
/// <summary>
74+
/// Registers the specified callback.
75+
/// </summary>
76+
/// <typeparam name="T1">The type of the first callback parameter.</typeparam>
77+
/// <typeparam name="T2">The type of the second callback parameter.</typeparam>
78+
/// <param name="callback">The callback.</param>
2679
void OnRequest<T1, T2>(Action<ICommunicationMessage, T1, T2> callback);
2780

81+
/// <summary>
82+
/// Registers the specified callback.
83+
/// </summary>
84+
/// <typeparam name="T1">The type of the first callback parameter.</typeparam>
85+
/// <typeparam name="T2">The type of the second callback parameter.</typeparam>
86+
/// <typeparam name="T3">The type of the third callback parameter.</typeparam>
87+
/// <param name="callback">The callback.</param>
2888
void OnRequest<T1, T2, T3>(Action<ICommunicationMessage, T1, T2, T3> callback);
2989

90+
/// <summary>
91+
/// Registers the specified callback.
92+
/// </summary>
93+
/// <typeparam name="T1">The type of the first callback parameter.</typeparam>
94+
/// <typeparam name="T2">The type of the second callback parameter.</typeparam>
95+
/// <typeparam name="T3">The type of the third callback parameter.</typeparam>
96+
/// <typeparam name="T4">The type of the fourth callback parameter.</typeparam>
97+
/// <param name="callback">The callback.</param>
3098
void OnRequest<T1, T2, T3, T4>(Action<ICommunicationMessage, T1, T2, T3, T4> callback);
3199

100+
/// <summary>
101+
/// Registers the specified callback.
102+
/// </summary>
103+
/// <typeparam name="T1">The type of the first callback parameter.</typeparam>
104+
/// <typeparam name="T2">The type of the second callback parameter.</typeparam>
105+
/// <typeparam name="T3">The type of the third callback parameter.</typeparam>
106+
/// <typeparam name="T4">The type of the fourth callback parameter.</typeparam>
107+
/// <typeparam name="T5">The type of the fifth callback parameter.</typeparam>
108+
/// <param name="callback">The callback.</param>
32109
void OnRequest<T1, T2, T3, T4, T5>(Action<ICommunicationMessage, T1, T2, T3, T4, T5> callback);
33110
}
34111
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
namespace NFive.SDK.Client.Communications
22
{
3-
public interface ICommunicationReceiveClient : ICommunicationReceive
4-
{
5-
6-
}
3+
public interface ICommunicationReceiveClient : ICommunicationReceive { }
74
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
namespace NFive.SDK.Client.Communications
22
{
3-
public interface ICommunicationReceiveServer : ICommunicationReceive
4-
{
5-
6-
}
3+
public interface ICommunicationReceiveServer : ICommunicationReceive { }
74
}
+21-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
1-
using NFive.SDK.Client.Events;
1+
using JetBrains.Annotations;
22

33
namespace NFive.SDK.Client.Communications
44
{
5+
[PublicAPI]
56
public interface ICommunicationTarget
67
{
7-
IEventManager EventManager { get; }
8-
string Event { get; }
8+
/// <summary>
9+
/// Returns a communication adapter for transmitting, targeting the local client.
10+
/// </summary>
11+
/// <returns>A local client targeted communication adapter for transmitting.</returns>
912
ICommunicationTransmitClient ToClient();
13+
14+
/// <summary>
15+
/// Returns a communication adapter for receiving, targeting the local client.
16+
/// </summary>
17+
/// <returns>A local client targeted communication adapter for receiving.</returns>
1018
ICommunicationReceiveClient FromClient();
19+
20+
/// <summary>
21+
/// Returns a communication adapter adapter for transmitting to the server.
22+
/// </summary>
23+
/// <returns>A server targeted communication adapter for transmitting.</returns>
1124
ICommunicationTransmitServer ToServer();
25+
26+
/// <summary>
27+
/// Returns a communication adapter for receiving from the server.
28+
/// </summary>
29+
/// <returns>A server targeted communication adapter for receiving.</returns>
1230
ICommunicationReceiveServer FromServer();
1331
}
1432
}

Communications/ICommunicationTransmit.cs

+49-6
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,60 @@ namespace NFive.SDK.Client.Communications
77
[PublicAPI]
88
public interface ICommunicationTransmit
99
{
10+
/// <summary>
11+
/// Emits the specified payloads.
12+
/// </summary>
13+
/// <param name="payloads">The payloads.</param>
1014
void Emit(params object[] payloads);
1115

12-
Task<T1> Request<T1>(params object[] payloads);
16+
/// <summary>
17+
/// Requests the specified type with the specified parameters.
18+
/// </summary>
19+
/// <typeparam name="TReturn">The type of the return.</typeparam>
20+
/// <param name="payloads">The payloads.</param>
21+
/// <returns></returns>
22+
Task<TReturn> Request<TReturn>(params object[] payloads);
1323

14-
Task<Tuple<T1, T2>> Request<T1, T2>(params object[] payloads);
24+
/// <summary>
25+
/// Requests the specified types with the specified parameters.
26+
/// </summary>
27+
/// <typeparam name="TReturn1">The type of the return1.</typeparam>
28+
/// <typeparam name="TReturn2">The type of the return2.</typeparam>
29+
/// <param name="payloads">The payloads.</param>
30+
/// <returns>The requested types.</returns>
31+
Task<Tuple<TReturn1, TReturn2>> Request<TReturn1, TReturn2>(params object[] payloads);
1532

16-
Task<Tuple<T1, T2, T3>> Request<T1, T2, T3>(params object[] payloads);
33+
/// <summary>
34+
/// Requests the specified types with the specified parameters.
35+
/// </summary>
36+
/// <typeparam name="TReturn1">The type of the 1.</typeparam>
37+
/// <typeparam name="TReturn2">The type of the 2.</typeparam>
38+
/// <typeparam name="TReturn3">The type of the 3.</typeparam>
39+
/// <param name="payloads">The payloads.</param>
40+
/// <returns>The requested types.</returns>
41+
Task<Tuple<TReturn1, TReturn2, TReturn3>> Request<TReturn1, TReturn2, TReturn3>(params object[] payloads);
1742

18-
Task<Tuple<T1, T2, T3, T4>> Request<T1, T2, T3, T4>(params object[] payloads);
19-
20-
Task<Tuple<T1, T2, T3, T4, T5>> Request<T1, T2, T3, T4, T5>(params object[] payloads);
43+
/// <summary>
44+
/// Requests the specified types with the specified parameters.
45+
/// </summary>
46+
/// <typeparam name="TReturn1">The type of the 1.</typeparam>
47+
/// <typeparam name="TReturn2">The type of the 2.</typeparam>
48+
/// <typeparam name="TReturn3">The type of the 3.</typeparam>
49+
/// <typeparam name="TReturn4">The type of the 4.</typeparam>
50+
/// <param name="payloads">The payloads.</param>
51+
/// <returns>The requested types.</returns>
52+
Task<Tuple<TReturn1, TReturn2, TReturn3, TReturn4>> Request<TReturn1, TReturn2, TReturn3, TReturn4>(params object[] payloads);
2153

54+
/// <summary>
55+
/// Requests the specified types with the specified parameters.
56+
/// </summary>
57+
/// <typeparam name="TReturn1">The type of the 1.</typeparam>
58+
/// <typeparam name="TReturn2">The type of the 2.</typeparam>
59+
/// <typeparam name="TReturn3">The type of the 3.</typeparam>
60+
/// <typeparam name="TReturn4">The type of the 4.</typeparam>
61+
/// <typeparam name="TReturn5">The type of the 5.</typeparam>
62+
/// <param name="payloads">The payloads.</param>
63+
/// <returns>The requested types.</returns>
64+
Task<Tuple<TReturn1, TReturn2, TReturn3, TReturn4, TReturn5>> Request<TReturn1, TReturn2, TReturn3, TReturn4, TReturn5>(params object[] payloads);
2265
}
2366
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
namespace NFive.SDK.Client.Communications
22
{
3-
public interface ICommunicationTransmitClient : ICommunicationTransmit
4-
{
5-
6-
}
3+
public interface ICommunicationTransmitClient : ICommunicationTransmit { }
74
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
namespace NFive.SDK.Client.Communications
22
{
3-
public interface ICommunicationTransmitServer : ICommunicationTransmit
4-
{
5-
6-
}
3+
public interface ICommunicationTransmitServer : ICommunicationTransmit { }
74
}

Events/IEventManager.cs

-34
This file was deleted.

Events/ITickManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using JetBrains.Annotations;
21
using System;
32
using System.Threading.Tasks;
3+
using JetBrains.Annotations;
44

55
namespace NFive.SDK.Client.Events
66
{

0 commit comments

Comments
 (0)