first commit
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using System.Xml.Linq;
|
||||
using CRIF.ACTion.Configuration;
|
||||
|
||||
namespace CRIF.ACTion.Common.Builders
|
||||
{
|
||||
public class CrifRequestSection : IBuildable
|
||||
{
|
||||
private readonly XNamespace SectionNamespace;
|
||||
private readonly string SectionName;
|
||||
private readonly List<XObject> Content;
|
||||
private readonly List<XObject> Attributes;
|
||||
|
||||
private protected readonly CrifSettings _settings;
|
||||
|
||||
private protected CrifRequestSection(XNamespace sectionNamespace, string sectionName, CrifSettings settings)
|
||||
{
|
||||
SectionNamespace = sectionNamespace;
|
||||
SectionName = sectionName;
|
||||
|
||||
Content = [];
|
||||
Attributes = [];
|
||||
|
||||
_settings = settings;
|
||||
}
|
||||
|
||||
public XElement Build(params XElement[] content)
|
||||
{
|
||||
var element = new XElement(SectionNamespace + SectionName, Attributes);
|
||||
element.Add([.. Content]);
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
public void AddContent(XObject element)
|
||||
{
|
||||
Content.Add(element);
|
||||
}
|
||||
|
||||
public void AddAttribute(XObject attribute)
|
||||
{
|
||||
Attributes.Add(attribute);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user