Skip to content

Commit 03edb48

Browse files
committed
* Don’t crash when SniReaderStream.PeekAtSniHost returns null
* Code clean-up, mostly file-scoped namespaces and naming violations
1 parent ad230dd commit 03edb48

35 files changed

Lines changed: 7079 additions & 7336 deletions

.editorconfig

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ csharp_style_expression_bodied_accessors = true
9393
csharp_style_expression_bodied_constructors = false
9494
csharp_style_expression_bodied_indexers = true
9595
csharp_style_expression_bodied_lambdas = true
96-
csharp_style_expression_bodied_local_functions = false
97-
csharp_style_expression_bodied_methods = false
98-
csharp_style_expression_bodied_operators = false
96+
csharp_style_expression_bodied_local_functions = true
97+
csharp_style_expression_bodied_methods = true
98+
csharp_style_expression_bodied_operators = true
9999
csharp_style_expression_bodied_properties = true
100100

101101
# Pattern matching preferences
@@ -199,13 +199,13 @@ dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
199199
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
200200
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
201201

202-
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
203-
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
204-
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
202+
dotnet_naming_rule.public_non_field_members_should_be_pascal_case.severity = suggestion
203+
dotnet_naming_rule.public_non_field_members_should_be_pascal_case.symbols = public_non_field_members
204+
dotnet_naming_rule.public_non_field_members_should_be_pascal_case.style = pascal_case
205205

206-
dotnet_naming_rule.private_method_should_be_camel_case.severity = suggestion
207-
dotnet_naming_rule.private_method_should_be_camel_case.symbols = private_method
208-
dotnet_naming_rule.private_method_should_be_camel_case.style = camel_case
206+
dotnet_naming_rule.private_non_field_members_should_be_camel_case.severity = suggestion
207+
dotnet_naming_rule.private_non_field_members_should_be_camel_case.symbols = private_non_field_members
208+
dotnet_naming_rule.private_non_field_members_should_be_camel_case.style = camel_case
209209

210210
dotnet_naming_rule.private_or_internal_field_should_be_begins_with__.severity = suggestion
211211
dotnet_naming_rule.private_or_internal_field_should_be_begins_with__.symbols = private_or_internal_field
@@ -225,13 +225,13 @@ dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
225225
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
226226
dotnet_naming_symbols.types.required_modifiers =
227227

228-
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
229-
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
230-
dotnet_naming_symbols.non_field_members.required_modifiers =
228+
dotnet_naming_symbols.public_non_field_members.applicable_kinds = property, event, method
229+
dotnet_naming_symbols.public_non_field_members.applicable_accessibilities = public, internal
230+
dotnet_naming_symbols.public_non_field_members.required_modifiers =
231231

232-
dotnet_naming_symbols.private_method.applicable_kinds = method
233-
dotnet_naming_symbols.private_method.applicable_accessibilities = private
234-
dotnet_naming_symbols.private_method.required_modifiers =
232+
dotnet_naming_symbols.private_non_field_members.applicable_kinds = property, event, method
233+
dotnet_naming_symbols.private_non_field_members.applicable_accessibilities = private, protected, protected_internal, private_protected
234+
dotnet_naming_symbols.private_non_field_members.required_modifiers =
235235

236236
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
237237
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private
@@ -325,3 +325,6 @@ dotnet_diagnostic.SYSLIB1045.severity = none
325325

326326
# CA1859: Use concrete types when possible for improved performance
327327
dotnet_diagnostic.CA1859.severity = none
328+
329+
# IDE0305: Let me use .ToArray()/.ToList()
330+
dotnet_diagnostic.IDE0305.severity = none

Src/AjaxAttributes.cs

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
using System;
22

3-
namespace RT.Servers
3+
namespace RT.Servers;
4+
5+
/// <summary>Specifies that a method can be called via AJAX using an <see cref="AjaxHandler{TApi}"/>.</summary>
6+
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
7+
public sealed class AjaxMethodAttribute : Attribute
48
{
5-
/// <summary>Specifies that a method can be called via AJAX using an <see cref="AjaxHandler{TApi}"/>.</summary>
6-
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
7-
public sealed class AjaxMethodAttribute : Attribute
8-
{
9-
}
9+
}
1010

11-
/// <summary>Specifies that a parameter receives the HTTP request object. To be used on methods with <see cref="AjaxMethodAttribute"/>.</summary>
12-
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
13-
public sealed class AjaxRequestAttribute : Attribute
14-
{
15-
}
11+
/// <summary>Specifies that a parameter receives the HTTP request object. To be used on methods with <see cref="AjaxMethodAttribute"/>.</summary>
12+
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
13+
public sealed class AjaxRequestAttribute : Attribute
14+
{
15+
}
1616

17-
/// <summary>
18-
/// Specifies that <see cref="AjaxHandler{TApi}"/> should use this method to convert serialized values from one type
19-
/// to another before calling an AJAX method.</summary>
20-
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
21-
public sealed class AjaxConverterAttribute : Attribute
22-
{
23-
}
17+
/// <summary>
18+
/// Specifies that <see cref="AjaxHandler{TApi}"/> should use this method to convert serialized values from one type
19+
/// to another before calling an AJAX method.</summary>
20+
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
21+
public sealed class AjaxConverterAttribute : Attribute
22+
{
2423
}

0 commit comments

Comments
 (0)