ValueElement.cs
35 lines
| 907 B
| text/x-csharp
|
CSharpLexer
cin
|
r279 | using System.Collections.Generic; | |
cin
|
r273 | using System.Xml.Serialization; | |
namespace Implab.ServiceHost.Unity { | |||
cin
|
r279 | public class ValueElement : AbstractRegistration, IInstanceRegistration { | |
cin
|
r273 | [XmlAttribute("value")] | |
public string Value { get; set; } | |||
cin
|
r274 | [XmlText] | |
public string Text { get; set; } | |||
cin
|
r277 | string GetTextValue() { | |
return string.IsNullOrEmpty(Value) ? Text : Value; | |||
cin
|
r274 | } | |
public string TypeName { | |||
get { | |||
return RegistrationType; | |||
} | |||
} | |||
cin
|
r279 | public IEnumerable<IInjectionParameter> MemberInjections { | |
get { | |||
yield return new ValueParameterElement { | |||
Value = Value, | |||
Text = Text | |||
}; | |||
} | |||
} | |||
public override void Visit(ContainerBuilder builder) { | |||
builder.Visit(this); | |||
cin
|
r273 | } | |
} | |||
} |