-
Notifications
You must be signed in to change notification settings - Fork 37
/
IPolicyList.cs
52 lines (47 loc) · 2.06 KB
/
IPolicyList.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;
namespace Unity.Policy
{
/// <summary>
/// A custom collection over <see cref="Object"/> objects.
/// </summary>
public interface IPolicyList
{
/// <summary>
/// Get default policy for the type
/// </summary>
/// <param name="type">Type of the registration</param>
/// <param name="policyInterface">Type of policy to retrieve</param>
/// <returns>Instance of the policy or null if none found</returns>
object Get(Type type, Type policyInterface);
/// <summary>
/// Get policy
/// </summary>
/// <param name="type">Type of the registration</param>
/// <param name="name">Name of the registration</param>
/// <param name="policyInterface">Type of policy to retrieve</param>
/// <returns>Instance of the policy or null if none found</returns>
object Get(Type type, string name, Type policyInterface);
/// <summary>
/// Set default policy for the type
/// </summary>
/// <param name="type">Type of the registration</param>
/// <param name="policyInterface">Type of policy to be set</param>
/// <param name="policy">Policy instance to be set</param>
void Set(Type type, Type policyInterface, object policy);
/// <summary>
/// Set policy
/// </summary>
/// <param name="type">Type of the registration</param>
/// <param name="name">Name of the registration</param>
/// <param name="policyInterface">Type of policy to be set</param>
/// <param name="policy">Policy instance to be set</param>
void Set(Type type, string name, Type policyInterface, object policy);
/// <summary>
/// Remove specific policy from the list
/// </summary>
/// <param name="type">Type of the registration</param>
/// <param name="name">Name of the registration</param>
/// <param name="policyInterface">Type of policy to be removed</param>
void Clear(Type type, string name, Type policyInterface);
}
}