Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XacmlAttributeAssignmentExpression"/> class.
 /// </summary>
 /// <param name="attributeId">The attribute identifier. The value of the AttributeId attribute in the resulting <AttributeAssignment/> element MUST be equal to this value.</param>
 /// <param name="expressionElement">The expression which evaluates to a constant attribute value or a bag of zero or more attribute values.See section 5.25.</param>
 public XacmlAttributeAssignmentExpression(Uri attributeId, IXacmlExpression expressionElement)
 {
     Guard.ArgumentNotNull(attributeId, nameof(attributeId));
     Guard.ArgumentNotNull(expressionElement, nameof(expressionElement));
     this.attributeId = attributeId;
     this.Property    = expressionElement;
 }
Ejemplo n.º 2
0
        private static void WriteExpression(XmlWriter writer, IXacmlExpression xacmlExpression)
        {
            switch (xacmlExpression.GetType().Name)
            {
            case "XacmlAttributeValue":
                WriteAttributeValue(writer, (XacmlAttributeValue)xacmlExpression);
                break;

            case "XacmlAttributeDesignator":
                WriteAttributeDesignator(writer, (XacmlAttributeDesignator)xacmlExpression);
                break;

            case "XacmlAttributeSelector":
            case "XacmlApply":
            case "XacmlVariableReference":
            case "XacmlFunction":
            default:
                throw new NotImplementedException($"XacmlSerializer: Serialization of type {xacmlExpression.GetType().Name} currently not supported");
            }
        }