DependencyParameterElement.cs
16 lines
| 531 B
| text/x-csharp
|
CSharpLexer
cin
|
r272 | using System.Xml.Serialization; | |
namespace Implab.ServiceHost.Unity { | |||
cin
|
r277 | public class DependencyParameterElement : InjectionParameterElement { | |
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 | } | |
} |