DependencyParameterElement.cs
16 lines
| 532 B
| text/x-csharp
|
CSharpLexer
cin
|
r272 | using System.Xml.Serialization; | |
namespace Implab.ServiceHost.Unity { | |||
cin
|
r281 | public class DependencyParameterElement : AbstractInjectionParameter { | |
cin
|
r272 | ||
[XmlAttribute("name")] | |||
public string DependencyName { get; set; } | |||
[XmlAttribute("optional")] | |||
public bool Optional { get; set; } | |||
cin
|
r274 | ||
cin
|
r278 | public override void Visit(InjectionParameterBuilder builder) { | |
cin
|
r277 | var type = builder.ResolveInjectedValueType(TypeName); | |
cin
|
r279 | builder.SetDependency(type, DependencyName, Optional); | |
cin
|
r274 | } | |
cin
|
r270 | } | |
} |