Fixed warnings

This commit is contained in:
Alexandru Macocian
2021-06-03 13:15:06 +02:00
parent 1a012c5d49
commit 25c3f771db
4 changed files with 37 additions and 3 deletions
@@ -1,24 +1,42 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
namespace Slim.Exceptions
{
/// <summary>
/// Exception thrown when <see cref="IServiceManager"/> fails to create a service.
/// </summary>
public class DependencyInjectionException : Exception
{
/// <summary>
/// Creates a new instance of <see cref="DependencyInjectionException"/>.
/// </summary>
public DependencyInjectionException()
{
}
/// <summary>
/// Creates a new instance of <see cref="DependencyInjectionException"/>.
/// </summary>
/// <param name="message">Message of the exception.</param>
public DependencyInjectionException(string message) : base(message)
{
}
/// <summary>
/// Creates a new instance of <see cref="DependencyInjectionException"/>.
/// </summary>
/// <param name="message">Message of the exception.</param>
/// <param name="innerException">Inner exception.</param>
public DependencyInjectionException(string message, Exception innerException) : base(message, innerException)
{
}
/// <summary>
/// Creates a new instance of <see cref="DependencyInjectionException"/>.
/// </summary>
/// <param name="info">Serialization info.</param>
/// <param name="context">Streaming context.</param>
protected DependencyInjectionException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
+14
View File
@@ -2,9 +2,23 @@
namespace Slim.Resolvers
{
/// <summary>
/// Resolver that can be added to a <see cref="IServiceManager"/> to manually resolve a dependency.
/// </summary>
public interface IDependencyResolver
{
/// <summary>
/// Returns true if the <see cref="IDependencyResolver"/> can resolve the dependency of provided <see cref="Type"/>.
/// </summary>
/// <param name="type"><see cref="Type"/> of dependency to be resolved.</param>
/// <returns>True if <see cref="IDependencyResolver"/> can resolve the dependency. Otherwise false.</returns>
bool CanResolve(Type type);
/// <summary>
/// Returns a resolved dependency of the provided type.
/// </summary>
/// <param name="serviceProvider">Reference to the calling <see cref="IServiceProvider"/>.</param>
/// <param name="type"><see cref="Type"/> of the dependency to be resolved.</param>
/// <returns>Resolved dependency of provided <see cref="Type"/>.</returns>
object Resolve(IServiceProvider serviceProvider, Type type);
}
}
+3
View File
@@ -18,6 +18,9 @@ namespace Slim
private Dictionary<Type, Delegate> ExceptionHandlers { get; } = new Dictionary<Type, Delegate>();
private List<IDependencyResolver> Resolvers { get; } = new List<IDependencyResolver>();
/// <summary>
/// Creates an instance of <see cref="IServiceManager"/>.
/// </summary>
public ServiceManager()
{
}
-1
View File
@@ -12,7 +12,6 @@
<FileVersion>1.4.3.0</FileVersion>
<PackageProjectUrl>https://github.com/AlexMacocian/Slim</PackageProjectUrl>
<Version>1.4.3</Version>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseFile>LICENSE</PackageLicenseFile>