mirror of
https://github.com/AlexMacocian/Slim.git
synced 2026-07-25 08:22:12 +00:00
Fixed warnings
This commit is contained in:
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user