From 11063eda2e538cadcf1912906073d7cd8b188e1d Mon Sep 17 00:00:00 2001 From: Alexanderius Date: Sat, 1 Jun 2024 12:48:34 +0500 Subject: [PATCH] [add] missing XML comments [r] method name [del] unused variable --- src/Simplify.Web/ActionModulesAccessor.cs | 1 + .../System/AssembliesFilterExtensions.cs | 2 +- .../System/ReadOnyDictionaryExtensions.cs | 7 ++++++ .../System/SimplifyWebTypesFinder.cs | 12 ++++++++-- src/Simplify.Web/System/StringConverter.cs | 13 ++++++++++- src/Simplify.Web/System/StringExtensions.cs | 2 +- src/Simplify.Web/System/TypeExtensions.cs | 22 ++++++++++++++++++- .../Views/Meta/IViewsMetaStore.cs | 3 +++ src/Simplify.Web/Views/Meta/ViewsMetaStore.cs | 8 +++++++ src/Simplify.Web/Views/ViewFactory.cs | 2 ++ 10 files changed, 66 insertions(+), 6 deletions(-) diff --git a/src/Simplify.Web/ActionModulesAccessor.cs b/src/Simplify.Web/ActionModulesAccessor.cs index 3f93eca8..8ba4c31f 100644 --- a/src/Simplify.Web/ActionModulesAccessor.cs +++ b/src/Simplify.Web/ActionModulesAccessor.cs @@ -8,6 +8,7 @@ namespace Simplify.Web; /// /// Provides the action modules accessor base class. /// +/// public abstract class ActionModulesAccessor : ModulesAccessor { /// diff --git a/src/Simplify.Web/System/AssembliesFilterExtensions.cs b/src/Simplify.Web/System/AssembliesFilterExtensions.cs index c9dabc49..184236ac 100644 --- a/src/Simplify.Web/System/AssembliesFilterExtensions.cs +++ b/src/Simplify.Web/System/AssembliesFilterExtensions.cs @@ -6,7 +6,7 @@ namespace Simplify.Web.System; /// -/// Provides the Assembly filter extensions +/// Provides the filter extensions. /// public static class AssembliesFilterExtensions { diff --git a/src/Simplify.Web/System/ReadOnyDictionaryExtensions.cs b/src/Simplify.Web/System/ReadOnyDictionaryExtensions.cs index 5e49f60c..b037d118 100644 --- a/src/Simplify.Web/System/ReadOnyDictionaryExtensions.cs +++ b/src/Simplify.Web/System/ReadOnyDictionaryExtensions.cs @@ -3,8 +3,15 @@ namespace Simplify.Web.System; +/// +/// Provides the dictionary extensions. +/// public static class DictionaryExtensions { + /// + /// Converts to dictionary to . + /// + /// The dictionary. public static ExpandoObject ToExpandoObject(this IReadOnlyDictionary dictionary) { var expando = new ExpandoObject(); diff --git a/src/Simplify.Web/System/SimplifyWebTypesFinder.cs b/src/Simplify.Web/System/SimplifyWebTypesFinder.cs index 3593a907..37cc3067 100644 --- a/src/Simplify.Web/System/SimplifyWebTypesFinder.cs +++ b/src/Simplify.Web/System/SimplifyWebTypesFinder.cs @@ -50,12 +50,20 @@ public static class SimplifyWebTypesFinder /// /// Finds the all types derived from specified type in the current domain assemblies. /// - /// + /// The type. public static IEnumerable FindTypesDerivedFrom() => FindTypesDerivedFrom(typeof(T)); + /// + /// Finds the types derived from. + /// + /// The types. public static IEnumerable FindTypesDerivedFrom(IEnumerable types) => types .SelectMany(FindTypesDerivedFrom); + /// + /// Finds the types derived from. + /// + /// The types. public static IEnumerable FindTypesDerivedFrom(params Type[] types) => types .SelectMany(FindTypesDerivedFrom); @@ -100,7 +108,7 @@ public static IList GetIgnoredIocRegistrationTypes() } /// - /// Clean up the loaded information about assemblies and types + /// Clean up the loaded information about assemblies and types. /// public static void CleanLoadedTypesAndAssembliesInfo() { diff --git a/src/Simplify.Web/System/StringConverter.cs b/src/Simplify.Web/System/StringConverter.cs index 8370f77f..11d2edfc 100644 --- a/src/Simplify.Web/System/StringConverter.cs +++ b/src/Simplify.Web/System/StringConverter.cs @@ -4,10 +4,16 @@ namespace Simplify.Web.System; +/// +/// Provides the string converter. +/// public static class StringConverter { + /// + /// Provides the value converters list + /// public static readonly IReadOnlyDictionary> ValueConverters = - new Dictionary>() + new Dictionary> { { typeof(string), sourceValue => sourceValue }, { typeof(int), GetIntParameterValue }, @@ -22,6 +28,11 @@ public static class StringConverter { typeof(bool[]), GetBoolArrayParameterValue } }; + /// + /// Tries the convert the string to the object of specified type. + /// + /// Type of the destination. + /// The source value. public static object? TryConvert(Type destinationType, string sourceValue) => ValueConverters.TryGetValue(destinationType, out var converter) ? converter(sourceValue) diff --git a/src/Simplify.Web/System/StringExtensions.cs b/src/Simplify.Web/System/StringExtensions.cs index 762191f5..4442dbed 100644 --- a/src/Simplify.Web/System/StringExtensions.cs +++ b/src/Simplify.Web/System/StringExtensions.cs @@ -4,7 +4,7 @@ namespace Simplify.Web.System; /// -/// Provides String extensions +/// Provides the extensions. /// public static class StringExtensions { diff --git a/src/Simplify.Web/System/TypeExtensions.cs b/src/Simplify.Web/System/TypeExtensions.cs index 0e5a5f3d..d453627e 100644 --- a/src/Simplify.Web/System/TypeExtensions.cs +++ b/src/Simplify.Web/System/TypeExtensions.cs @@ -5,7 +5,7 @@ namespace Simplify.Web.System; /// -/// Provides the Type extensions +/// Provides the extensions. /// public static class TypeExtensions { @@ -27,8 +27,24 @@ public static bool IsTypeOf(this Type t, Type type) } } + /// + /// Determines whether the type is derived from one of the specified types. + /// + /// The t. + /// The types. + /// + /// true if the type is derived from one of the specified types; otherwise, false. + /// public static bool IsDerivedFrom(this Type t, params Type[] types) => types.Any(t.IsDerivedFrom); + /// + /// Determines whether the type is derived from other type. + /// + /// The t. + /// The type. + /// + /// true if the type is derived from other type; otherwise, false. + /// public static bool IsDerivedFrom(this Type t, Type type) { if (t.IsAbstract) @@ -49,5 +65,9 @@ public static bool IsDerivedFrom(this Type t, Type type) return false; } + /// + /// Gets the type names as string. + /// + /// The types. public static string GetTypeNamesAsString(this IEnumerable types) => string.Join(", ", types.Select(type => type.Name)); } \ No newline at end of file diff --git a/src/Simplify.Web/Views/Meta/IViewsMetaStore.cs b/src/Simplify.Web/Views/Meta/IViewsMetaStore.cs index 294afe00..3dd14c2d 100644 --- a/src/Simplify.Web/Views/Meta/IViewsMetaStore.cs +++ b/src/Simplify.Web/Views/Meta/IViewsMetaStore.cs @@ -11,5 +11,8 @@ public interface IViewsMetaStore /// /// Gets the current domain views types /// + /// + /// The views types list. + /// IList ViewsTypes { get; } } \ No newline at end of file diff --git a/src/Simplify.Web/Views/Meta/ViewsMetaStore.cs b/src/Simplify.Web/Views/Meta/ViewsMetaStore.cs index 33d9a424..06c64027 100644 --- a/src/Simplify.Web/Views/Meta/ViewsMetaStore.cs +++ b/src/Simplify.Web/Views/Meta/ViewsMetaStore.cs @@ -8,6 +8,7 @@ namespace Simplify.Web.Views.Meta; /// /// Provides the views meta information store. /// +/// public class ViewsMetaStore : IViewsMetaStore { private static IViewsMetaStore? _current; @@ -16,6 +17,10 @@ public class ViewsMetaStore : IViewsMetaStore /// /// Gets the current views meta store. /// + /// + /// The current. + /// + /// value public static IViewsMetaStore Current { get => _current ??= new ViewsMetaStore(); @@ -25,6 +30,9 @@ public static IViewsMetaStore Current /// /// Gets the current domain views types. /// + /// + /// The views types list. + /// public IList ViewsTypes { get diff --git a/src/Simplify.Web/Views/ViewFactory.cs b/src/Simplify.Web/Views/ViewFactory.cs index 0ffc2588..358a0232 100644 --- a/src/Simplify.Web/Views/ViewFactory.cs +++ b/src/Simplify.Web/Views/ViewFactory.cs @@ -10,6 +10,8 @@ namespace Simplify.Web.Views; /// /// Provides the view factory. /// +/// +/// public class ViewFactory(IDIResolver resolver) : ModulesAccessorInjector(resolver), IViewFactory { private readonly IDIResolver _resolver = resolver;