-
-
Notifications
You must be signed in to change notification settings - Fork 338
/
Copy pathReinsertionService.cs
52 lines (48 loc) · 1.76 KB
/
ReinsertionService.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
namespace GeneticSharp
{
/// <summary>
/// Reinsertion service.
/// </summary>
public static class ReinsertionService
{
#region Methods
/// <summary>
/// Gets available reinsertion types.
/// </summary>
/// <returns>All available reinsertion types.</returns>
public static IList<Type> GetReinsertionTypes()
{
return TypeHelper.GetTypesByInterface<IReinsertion>();
}
/// <summary>
/// Gets the available reinsertion names.
/// </summary>
/// <returns>The reinsertion names.</returns>
public static IList<string> GetReinsertionNames()
{
return TypeHelper.GetDisplayNamesByInterface<IReinsertion>();
}
/// <summary>
/// Creates the IReinsertion's implementation with the specified name.
/// </summary>
/// <returns>The reinsertion implementation instance.</returns>
/// <param name="name">The reinsertion name.</param>
/// <param name="constructorArgs">Constructor arguments.</param>
public static IReinsertion CreateReinsertionByName(string name, params object[] constructorArgs)
{
return TypeHelper.CreateInstanceByName<IReinsertion>(name, constructorArgs);
}
/// <summary>
/// Gets the reinsertion type by the name.
/// </summary>
/// <returns>The reinsertion type.</returns>
/// <param name="name">The name of reinsertion.</param>
public static Type GetReinsertionTypeByName(string name)
{
return TypeHelper.GetTypeByName<IReinsertion>(name);
}
#endregion
}
}