-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathObjectFactoryConfiguration.cs
More file actions
82 lines (76 loc) · 3.34 KB
/
ObjectFactoryConfiguration.cs
File metadata and controls
82 lines (76 loc) · 3.34 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using RapidField.SolidInstruments.Core;
using RapidField.SolidInstruments.Core.ArgumentValidation;
using System;
using System.Diagnostics;
namespace RapidField.SolidInstruments.ObjectComposition
{
/// <summary>
/// Represents configuration information for an <see cref="ObjectFactory" /> instance.
/// </summary>
public sealed class ObjectFactoryConfiguration : ObjectFactoryConfiguration<Object>
{
/// <summary>
/// Initializes a new instance of the <see cref="ObjectFactoryConfiguration" /> class.
/// </summary>
public ObjectFactoryConfiguration()
: base()
{
return;
}
/// <summary>
/// Initializes a new instance of the <see cref="ObjectFactoryConfiguration" /> class.
/// </summary>
/// <param name="configuration">
/// Configuration information that is wrapped by the new configuration.
/// </param>
[DebuggerHidden]
internal ObjectFactoryConfiguration(ObjectFactoryConfiguration<Object> configuration)
: base(configuration.ProductionFunctions)
{
return;
}
}
/// <summary>
/// Represents configuration information for an <see cref="ObjectFactory{TProductBase}" /> instance.
/// </summary>
/// <typeparam name="TProductBase">
/// The base type from which objects produced by the associated factory derive.
/// </typeparam>
public class ObjectFactoryConfiguration<TProductBase> : InstrumentConfiguration
{
/// <summary>
/// Initializes a new instance of the <see cref="ObjectFactoryConfiguration{TProductBase}" /> class.
/// </summary>
public ObjectFactoryConfiguration()
: this(new ObjectFactoryConfigurationProductionFunctions<TProductBase>())
{
return;
}
/// <summary>
/// Initializes a new instance of the <see cref="ObjectFactoryConfiguration{TProductBase}" /> class.
/// </summary>
/// <param name="productionFunctions">
/// A collection of functions that produce supported types for the associated <see cref="ObjectFactory{TProductBase}" />.
/// </param>
/// <exception cref="ArgumentNullException">
/// <paramref name="productionFunctions" /> is <see langword="null" />.
/// </exception>
[DebuggerHidden]
internal ObjectFactoryConfiguration(IObjectFactoryConfigurationProductionFunctions<TProductBase> productionFunctions)
: base()
{
ProductionFunctions = productionFunctions.RejectIf().IsNull(nameof(productionFunctions)).TargetArgument;
}
/// <summary>
/// Gets a collection of functions that produce supported types for the associated
/// <see cref="ObjectFactory{TProductBase}" />.
/// </summary>
public IObjectFactoryConfigurationProductionFunctions<TProductBase> ProductionFunctions
{
get;
}
}
}