Beispiel #1
0
 public ClaimTransform(Uri transformId, Uri transformType, Match matchExpression, LiteralClaim targetClaim,
                       Term evaluationExpression)
 {
     TransformID     = transformId;
     Type            = transformType;
     MatchExpression = matchExpression;
     TargetClaim     = targetClaim;
     Expression      = evaluationExpression;
 }
Beispiel #2
0
        /// <summary>
        /// Reads the Xml of a scope transform.
        /// </summary>
        /// <param name="reader">An XmlReader for a scope transform.</param>
        public override void ReadXml(XmlReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            reader.MoveToRequiredStartElement(AuthorizationConstants.Elements.Transform);

            this.Type = new Uri(reader.GetRequiredAttribute(AuthorizationConstants.Attributes.Type));

            while (reader.Read())
            {
                if (reader.IsRequiredStartElement(AuthorizationConstants.Elements.Match))
                {
                    this.MatchExpression = Match.Load(reader);
                }

                if (reader.IsRequiredStartElement(AuthorizationConstants.Elements.TargetClaim))
                {
                    this.TargetClaim           = new LiteralClaim();
                    this.TargetClaim.ClaimType = reader.GetRequiredAttribute(AuthorizationConstants.Attributes.ClaimType);

                    if (!reader.IsEmptyElement)
                    {
                        this.TargetClaim.ClaimValue = reader.GetElementValue(AuthorizationConstants.Elements.TargetClaim);
                    }
                }

                if (reader.LocalName == AuthorizationConstants.Elements.Rule ||
                    reader.LocalName == AuthorizationConstants.Elements.LogicalAnd ||
                    reader.LocalName == AuthorizationConstants.Elements.LogicalOr)
                {
                    this.Expression = Term.Load(reader);
                }

                if (reader.IsRequiredEndElement(AuthorizationConstants.Elements.Transform))
                {
                    break;
                }
            }
        }
Beispiel #3
0
 public ClaimTransform(Uri transformId, Uri transformType, Match matchExpression, LiteralClaim targetClaim, Term evaluationExpression)
 {
     this.TransformID     = transformId;
     this.Type            = transformType;
     this.MatchExpression = matchExpression;
     this.TargetClaim     = targetClaim;
     this.Expression      = evaluationExpression;
 }
Beispiel #4
0
 public ClaimTransform(Uri transformType, Match matchExpression, LiteralClaim targetClaim)
     : this(null, transformType, matchExpression, targetClaim, null)
 {
 }
Beispiel #5
0
 public ClaimTransform(Uri transformType, LiteralClaim targetClaim)
     : this(null, transformType, null, targetClaim, null)
 {
 }