Skip to content

Commit

Permalink
[add] missing XML comments
Browse files Browse the repository at this point in the history
[r] method name
[del] unused variable
  • Loading branch information
i4004 committed Jun 1, 2024
1 parent 1f05342 commit 11063ed
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/Simplify.Web/ActionModulesAccessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Simplify.Web;
/// <summary>
/// Provides the action modules accessor base class.
/// </summary>
/// <seealso cref="ModulesAccessor" />
public abstract class ActionModulesAccessor : ModulesAccessor
{
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Simplify.Web/System/AssembliesFilterExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Simplify.Web.System;

/// <summary>
/// Provides the Assembly filter extensions
/// Provides the <see cref="Assembly" /> filter extensions.
/// </summary>
public static class AssembliesFilterExtensions
{
Expand Down
7 changes: 7 additions & 0 deletions src/Simplify.Web/System/ReadOnyDictionaryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@

namespace Simplify.Web.System;

/// <summary>
/// Provides the dictionary extensions.
/// </summary>
public static class DictionaryExtensions
{
/// <summary>
/// Converts to dictionary to <see cref="ExpandoObject" />.
/// </summary>
/// <param name="dictionary">The dictionary.</param>
public static ExpandoObject ToExpandoObject(this IReadOnlyDictionary<string, object> dictionary)
{
var expando = new ExpandoObject();
Expand Down
12 changes: 10 additions & 2 deletions src/Simplify.Web/System/SimplifyWebTypesFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,20 @@ public static class SimplifyWebTypesFinder
/// <summary>
/// Finds the all types derived from specified type in the current domain assemblies.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="T">The type.</typeparam>
public static IEnumerable<Type> FindTypesDerivedFrom<T>() => FindTypesDerivedFrom(typeof(T));

/// <summary>
/// Finds the types derived from.
/// </summary>
/// <param name="types">The types.</param>
public static IEnumerable<Type> FindTypesDerivedFrom(IEnumerable<Type> types) => types
.SelectMany(FindTypesDerivedFrom);

/// <summary>
/// Finds the types derived from.
/// </summary>
/// <param name="types">The types.</param>
public static IEnumerable<Type> FindTypesDerivedFrom(params Type[] types) => types
.SelectMany(FindTypesDerivedFrom);

Expand Down Expand Up @@ -100,7 +108,7 @@ public static IList<Type> GetIgnoredIocRegistrationTypes()
}

/// <summary>
/// Clean up the loaded information about assemblies and types
/// Clean up the loaded information about assemblies and types.
/// </summary>
public static void CleanLoadedTypesAndAssembliesInfo()
{
Expand Down
13 changes: 12 additions & 1 deletion src/Simplify.Web/System/StringConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@

namespace Simplify.Web.System;

/// <summary>
/// Provides the string converter.
/// </summary>
public static class StringConverter
{
/// <summary>
/// Provides the value converters list
/// </summary>
public static readonly IReadOnlyDictionary<Type, Func<string, object?>> ValueConverters =
new Dictionary<Type, Func<string, object?>>()
new Dictionary<Type, Func<string, object?>>
{
{ typeof(string), sourceValue => sourceValue },
{ typeof(int), GetIntParameterValue },
Expand All @@ -22,6 +28,11 @@ public static class StringConverter
{ typeof(bool[]), GetBoolArrayParameterValue }
};

/// <summary>
/// Tries the convert the string to the object of specified type.
/// </summary>
/// <param name="destinationType">Type of the destination.</param>
/// <param name="sourceValue">The source value.</param>
public static object? TryConvert(Type destinationType, string sourceValue) =>
ValueConverters.TryGetValue(destinationType, out var converter)
? converter(sourceValue)
Expand Down
2 changes: 1 addition & 1 deletion src/Simplify.Web/System/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Simplify.Web.System;

/// <summary>
/// Provides String extensions
/// Provides the <see cref="string" /> extensions.
/// </summary>
public static class StringExtensions
{
Expand Down
22 changes: 21 additions & 1 deletion src/Simplify.Web/System/TypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Simplify.Web.System;

/// <summary>
/// Provides the Type extensions
/// Provides the <see cref="Type" /> extensions.
/// </summary>
public static class TypeExtensions
{
Expand All @@ -27,8 +27,24 @@ public static bool IsTypeOf(this Type t, Type type)
}
}

/// <summary>
/// Determines whether the type is derived from one of the specified types.
/// </summary>
/// <param name="t">The t.</param>
/// <param name="types">The types.</param>
/// <returns>
/// <c>true</c> if the type is derived from one of the specified types; otherwise, <c>false</c>.
/// </returns>
public static bool IsDerivedFrom(this Type t, params Type[] types) => types.Any(t.IsDerivedFrom);

/// <summary>
/// Determines whether the type is derived from other type.
/// </summary>
/// <param name="t">The t.</param>
/// <param name="type">The type.</param>
/// <returns>
/// <c>true</c> if the type is derived from other type; otherwise, <c>false</c>.
/// </returns>
public static bool IsDerivedFrom(this Type t, Type type)
{
if (t.IsAbstract)
Expand All @@ -49,5 +65,9 @@ public static bool IsDerivedFrom(this Type t, Type type)
return false;
}

/// <summary>
/// Gets the type names as string.
/// </summary>
/// <param name="types">The types.</param>
public static string GetTypeNamesAsString(this IEnumerable<Type> types) => string.Join(", ", types.Select(type => type.Name));
}
3 changes: 3 additions & 0 deletions src/Simplify.Web/Views/Meta/IViewsMetaStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ public interface IViewsMetaStore
/// <summary>
/// Gets the current domain views types
/// </summary>
/// <value>
/// The views types list.
/// </value>
IList<Type> ViewsTypes { get; }
}
8 changes: 8 additions & 0 deletions src/Simplify.Web/Views/Meta/ViewsMetaStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Simplify.Web.Views.Meta;
/// <summary>
/// Provides the views meta information store.
/// </summary>
/// <seealso cref="IViewsMetaStore" />
public class ViewsMetaStore : IViewsMetaStore
{
private static IViewsMetaStore? _current;
Expand All @@ -16,6 +17,10 @@ public class ViewsMetaStore : IViewsMetaStore
/// <summary>
/// Gets the current views meta store.
/// </summary>
/// <value>
/// The current.
/// </value>
/// <exception cref="ArgumentNullException">value</exception>
public static IViewsMetaStore Current
{
get => _current ??= new ViewsMetaStore();
Expand All @@ -25,6 +30,9 @@ public static IViewsMetaStore Current
/// <summary>
/// Gets the current domain views types.
/// </summary>
/// <value>
/// The views types list.
/// </value>
public IList<Type> ViewsTypes
{
get
Expand Down
2 changes: 2 additions & 0 deletions src/Simplify.Web/Views/ViewFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ namespace Simplify.Web.Views;
/// <summary>
/// Provides the view factory.
/// </summary>
/// <seealso cref="ModulesAccessorInjector" />
/// <seealso cref="IViewFactory" />
public class ViewFactory(IDIResolver resolver) : ModulesAccessorInjector(resolver), IViewFactory
{
private readonly IDIResolver _resolver = resolver;
Expand Down

0 comments on commit 11063ed

Please sign in to comment.