From 2d507959760cbfeef65213a57e628f20329c6167 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 17 Dec 2022 20:13:32 +0000 Subject: [PATCH 1/2] Fix project Add missing xml documentation. --- nanoFramework.WebServer/Authentication.cs | 23 +++++++++++++++---- nanoFramework.WebServer/MethodAttribute.cs | 9 ++++++++ nanoFramework.WebServer/RouteAttribute.cs | 3 +++ .../nanoFramework.WebServer.nfproj | 3 +++ 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/nanoFramework.WebServer/Authentication.cs b/nanoFramework.WebServer/Authentication.cs index 952bd93..53eed4f 100644 --- a/nanoFramework.WebServer/Authentication.cs +++ b/nanoFramework.WebServer/Authentication.cs @@ -10,37 +10,52 @@ namespace nanoFramework.WebServer { /// - /// The authentication to be used by the server + /// The authentication to be used by the server. /// public class Authentication { /// - /// The type of authentication + /// The type of authentication. /// public AuthenticationType AuthenticationType { get; internal set; } /// - /// The network credential user and password + /// The network credential user and password. /// public NetworkCredential Credentials { get; internal set; } = null; /// - /// The API Key + /// The API Key. /// public string ApiKey { get; internal set; } = null; + /// + /// Authentication. + /// + /// + /// The network credential user and password. + /// public Authentication(NetworkCredential credential) { AuthenticationType = AuthenticationType.Basic; Credentials = credential; } + /// + /// Authentication. + /// + /// + /// The API Key. + /// public Authentication(string apiKey) { AuthenticationType = AuthenticationType.ApiKey; ApiKey = apiKey; } + /// + /// Authentication. + /// public Authentication() { AuthenticationType = AuthenticationType.None; diff --git a/nanoFramework.WebServer/MethodAttribute.cs b/nanoFramework.WebServer/MethodAttribute.cs index 5f489d4..b2e65a3 100644 --- a/nanoFramework.WebServer/MethodAttribute.cs +++ b/nanoFramework.WebServer/MethodAttribute.cs @@ -13,8 +13,17 @@ namespace nanoFramework.WebServer [AttributeUsage(AttributeTargets.Method)] public class MethodAttribute : Attribute { + /// + /// The Method. + /// public string Method { get; set; } + /// + /// The Method Attribute. + /// + /// + /// The method. + /// public MethodAttribute(string method) { Method = method; diff --git a/nanoFramework.WebServer/RouteAttribute.cs b/nanoFramework.WebServer/RouteAttribute.cs index d1bdf6e..b24a09f 100644 --- a/nanoFramework.WebServer/RouteAttribute.cs +++ b/nanoFramework.WebServer/RouteAttribute.cs @@ -13,6 +13,9 @@ namespace nanoFramework.WebServer [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] public class RouteAttribute : Attribute { + /// + /// The route. + /// public string Route { get; set; } /// diff --git a/nanoFramework.WebServer/nanoFramework.WebServer.nfproj b/nanoFramework.WebServer/nanoFramework.WebServer.nfproj index 6ae98e3..592f963 100644 --- a/nanoFramework.WebServer/nanoFramework.WebServer.nfproj +++ b/nanoFramework.WebServer/nanoFramework.WebServer.nfproj @@ -87,6 +87,9 @@ + + + From 36240b4438ce4b6662a514e745e259fd861bd988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 22 Dec 2022 14:34:10 +0000 Subject: [PATCH 2/2] Improve comments for Intellisense --- nanoFramework.WebServer/Authentication.cs | 10 +++++----- nanoFramework.WebServer/AuthenticationType.cs | 8 ++++---- nanoFramework.WebServer/MethodAttribute.cs | 14 ++++++++------ nanoFramework.WebServer/RouteAttribute.cs | 16 +++++++++++----- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/nanoFramework.WebServer/Authentication.cs b/nanoFramework.WebServer/Authentication.cs index 53eed4f..5e19473 100644 --- a/nanoFramework.WebServer/Authentication.cs +++ b/nanoFramework.WebServer/Authentication.cs @@ -20,17 +20,17 @@ public class Authentication public AuthenticationType AuthenticationType { get; internal set; } /// - /// The network credential user and password. + /// Gets or sets the network credentials that are sent to the host and used to authenticate the request. /// public NetworkCredential Credentials { get; internal set; } = null; /// - /// The API Key. + /// The API Key to use for authentication. /// public string ApiKey { get; internal set; } = null; /// - /// Authentication. + /// Initializes a new instance of the class. /// /// /// The network credential user and password. @@ -42,7 +42,7 @@ public Authentication(NetworkCredential credential) } /// - /// Authentication. + /// Initializes a new instance of the class. /// /// /// The API Key. @@ -54,7 +54,7 @@ public Authentication(string apiKey) } /// - /// Authentication. + /// Initializes a new instance of the class. /// public Authentication() { diff --git a/nanoFramework.WebServer/AuthenticationType.cs b/nanoFramework.WebServer/AuthenticationType.cs index a0c3e69..dc519d8 100644 --- a/nanoFramework.WebServer/AuthenticationType.cs +++ b/nanoFramework.WebServer/AuthenticationType.cs @@ -9,22 +9,22 @@ namespace nanoFramework.WebServer { /// - /// The type of authentication to use + /// The type of authentication to use. /// public enum AuthenticationType { /// - /// No authentication is needed + /// No authentication is needed. /// None, /// - /// Basic authentication with user and password + /// Basic authentication with user and password. /// Basic, /// - /// Using an ApiKey + /// Using an ApiKey. /// ApiKey } diff --git a/nanoFramework.WebServer/MethodAttribute.cs b/nanoFramework.WebServer/MethodAttribute.cs index b2e65a3..3f3ba6f 100644 --- a/nanoFramework.WebServer/MethodAttribute.cs +++ b/nanoFramework.WebServer/MethodAttribute.cs @@ -8,22 +8,24 @@ namespace nanoFramework.WebServer { /// - /// The HTTP Method + /// This attribute defines which HTTP Method the class method will handle. /// + /// + /// No validation is performed if the HTTP method is a valid one. + /// For details on how to use, see: https://github.com/nanoframework/nanoFramework.WebServer#usage + /// [AttributeUsage(AttributeTargets.Method)] public class MethodAttribute : Attribute { /// - /// The Method. + /// The HTTP Method to use. /// public string Method { get; set; } /// - /// The Method Attribute. + /// Initializes a new instance of the class. /// - /// - /// The method. - /// + /// The HTTP Method to handle./// public MethodAttribute(string method) { Method = method; diff --git a/nanoFramework.WebServer/RouteAttribute.cs b/nanoFramework.WebServer/RouteAttribute.cs index b24a09f..80e400f 100644 --- a/nanoFramework.WebServer/RouteAttribute.cs +++ b/nanoFramework.WebServer/RouteAttribute.cs @@ -8,24 +8,30 @@ namespace nanoFramework.WebServer { /// - /// Route custom attribute + /// This attribute defines which HTTP route a method will handle. /// + /// + /// For example: test/any. + /// For details on how to use, see: https://github.com/nanoframework/nanoFramework.WebServer#usage + /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] public class RouteAttribute : Attribute { /// - /// The route. + /// The route that the method will respond to. /// public string Route { get; set; } /// - /// A route attribute + /// Initializes a new instance of the class. /// - /// The route like route/second/third + /// The route the method will handle. + /// + /// For example: test/any. + /// For details on how to use, see: https://github.com/nanoframework/nanoFramework.WebServer#usage public RouteAttribute(string route) { Route = route; } - } }