Exemple #1
0
 /// <summary>
 /// Creates an instance of a TargetMatchBase with the values specified.
 /// </summary>
 /// <param name="matchId">The match id</param>
 /// <param name="attributeValue">The attribute value instance.</param>
 /// <param name="attributeReference">An attribute reference instance.</param>
 /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
 protected TargetMatchBaseReadWrite(string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion schemaVersion)
     : base(XacmlSchema.Policy, schemaVersion)
 {
     _id                 = matchId;
     _attributeValue     = attributeValue;
     _attributeReference = attributeReference;
 }
 /// <summary>
 /// Creates an instance of a TargetMatchBase with the values specified.
 /// </summary>
 /// <param name="matchId">The match id</param>
 /// <param name="attributeValue">The attribute value instance.</param>
 /// <param name="attributeReference">An attribute reference instance.</param>
 /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
 protected TargetMatchBaseReadWrite(string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion schemaVersion)
     : base(XacmlSchema.Policy, schemaVersion)
 {
     _id = matchId;
     _attributeValue = attributeValue;
     _attributeReference = attributeReference;
 }
Exemple #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAdd_Click(object sender, System.EventArgs e)
 {
     LoadingData = true;
     con.AttributeValueElementReadWrite att = new AttributeValueElementReadWrite("TODO: Add value", Xacml.XacmlVersion.Version11);
     lstAttributeValue.Items.Add(att);
     _attribute.AttributeValues.Add(att);
     LoadingData = false;
 }
Exemple #4
0
 /// <summary>
 /// Creates an instance of the TargetMatchBase class using the XmlReader specified, the name of the node that defines
 /// the match (the name of the node changes depending on the target item that defines it) and the attribute
 /// designator node name which also changes depending on the target item that defines the match.
 /// </summary>
 /// <param name="reader">The XmlReader positioned at the "matchNodeName" node.</param>
 /// <param name="matchNodeName">The name of the match node for this target item.</param>
 /// <param name="attributeDesignatorNode">The name of the attribute designator node for this target item.</param>
 /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
 protected TargetMatchBaseReadWrite(XmlReader reader, string matchNodeName, string attributeDesignatorNode, XacmlVersion schemaVersion)
     : base(XacmlSchema.Policy, schemaVersion)
 {
     if (reader == null)
     {
         throw new ArgumentNullException("reader");
     }
     if (reader.LocalName == matchNodeName && ValidateSchema(reader, schemaVersion))
     {
         _id = reader.GetAttribute(Consts.Schema1.MatchElement.MatchId);
         while (reader.Read())
         {
             if (reader.LocalName == Consts.Schema1.AttributeValueElement.AttributeValue &&
                 ValidateSchema(reader, schemaVersion) &&
                 reader.NodeType != XmlNodeType.EndElement)
             {
                 _attributeValue = new AttributeValueElementReadWrite(reader, schemaVersion);
             }
             else if (reader.LocalName == attributeDesignatorNode &&
                      ValidateSchema(reader, schemaVersion) &&
                      reader.NodeType != XmlNodeType.EndElement)
             {
                 _attributeReference = CreateAttributeDesignator(reader);
             }
             else if (reader.LocalName == Consts.Schema1.AttributeSelectorElement.AttributeSelector &&
                      ValidateSchema(reader, schemaVersion) &&
                      reader.NodeType != XmlNodeType.EndElement)
             {
                 _attributeReference = new AttributeSelectorElement(reader, schemaVersion);
             }
             else if (reader.LocalName == matchNodeName &&
                      reader.NodeType == XmlNodeType.EndElement)
             {
                 break;
             }
         }
     }
     else
     {
         throw new Exception(string.Format(Properties.Resource.exc_invalid_node_name, reader.LocalName));
     }
 }
 /// <summary>
 /// Creates an instance of the TargetMatchBase class using the XmlReader specified, the name of the node that defines
 /// the match (the name of the node changes depending on the target item that defines it) and the attribute
 /// designator node name which also changes depending on the target item that defines the match.
 /// </summary>
 /// <param name="reader">The XmlReader positioned at the "matchNodeName" node.</param>
 /// <param name="matchNodeName">The name of the match node for this target item.</param>
 /// <param name="attributeDesignatorNode">The name of the attribute designator node for this target item.</param>
 /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
 protected TargetMatchBaseReadWrite(XmlReader reader, string matchNodeName, string attributeDesignatorNode, XacmlVersion schemaVersion)
     : base(XacmlSchema.Policy, schemaVersion)
 {
     if (reader == null) throw new ArgumentNullException("reader");
     if (reader.LocalName == matchNodeName && ValidateSchema(reader, schemaVersion))
     {
         _id = reader.GetAttribute(Consts.Schema1.MatchElement.MatchId);
         while (reader.Read())
         {
             if (reader.LocalName == Consts.Schema1.AttributeValueElement.AttributeValue &&
                 ValidateSchema(reader, schemaVersion) &&
                 reader.NodeType != XmlNodeType.EndElement)
             {
                 _attributeValue = new AttributeValueElementReadWrite(reader, schemaVersion);
             }
             else if (reader.LocalName == attributeDesignatorNode &&
                 ValidateSchema(reader, schemaVersion) &&
                 reader.NodeType != XmlNodeType.EndElement)
             {
                 _attributeReference = CreateAttributeDesignator(reader);
             }
             else if (reader.LocalName == Consts.Schema1.AttributeSelectorElement.AttributeSelector &&
                 ValidateSchema(reader, schemaVersion) &&
                 reader.NodeType != XmlNodeType.EndElement)
             {
                 _attributeReference = new AttributeSelectorElement(reader, schemaVersion);
             }
             else if (reader.LocalName == matchNodeName &&
                 reader.NodeType == XmlNodeType.EndElement)
             {
                 break;
             }
         }
     }
     else
     {
         throw new Exception(string.Format(Properties.Resource.exc_invalid_node_name, reader.LocalName));
     }
 }
Exemple #6
0
 /// <summary>
 /// Creates an instance of the ActionMatch class using the specified arguments.
 /// </summary>
 /// <param name="matchId">The function id for this match.</param>
 /// <param name="attributeValue">The attribute value to use as the first parameter to the function.</param>
 /// <param name="attributeReference">The attribute reference in the context document.</param>
 /// <param name="version">The version of the schema that was used to validate.</param>
 public ActionMatchElement(string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion version) :
     base(matchId, attributeValue, attributeReference, version)
 {
 }
		/// <summary>
		/// Creates an instance of a SubjectMatch with the values specified.
		/// </summary>
		/// <param name="matchId">The match id</param>
		/// <param name="attributeValue">The attribute value instance.</param>
		/// <param name="attributeReference">An attribute reference instance.</param>
		/// <param name="version">The version of the schema that was used to validate.</param>
		public SubjectMatchElementReadWrite( string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion version )
			: base( matchId, attributeValue, attributeReference, version )
		{
		}
		/// <summary>
		/// Creates an instance of a TargetMatchBase with the values specified.
		/// </summary>
		/// <param name="matchId">The match id</param>
		/// <param name="attributeValue">The attribute value instance.</param>
		/// <param name="attributeReference">An attribute reference instance.</param>
		/// <param name="schemaVersion">The version of the schema that was used to validate.</param>
		protected TargetMatchBase( string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion schemaVersion )
			: base( matchId, attributeValue, attributeReference, schemaVersion )
		{
		}
		/// <summary>
		/// Clones an attribute value element into a new element.
		/// </summary>
		/// <param name="attributeValueElement">The value element to clone.</param>
		public AttributeValueElementReadWrite( AttributeValueElementReadWrite attributeValueElement )
			: base( XacmlSchema.Context, attributeValueElement.SchemaVersion )
		{
            if (attributeValueElement == null) throw new ArgumentNullException("attributeValueElement");
			_contents = attributeValueElement._contents;
		}
Exemple #10
0
 /// <summary>
 /// Creates an instance of a TargetMatchBase with the values specified.
 /// </summary>
 /// <param name="matchId">The match id</param>
 /// <param name="attributeValue">The attribute value instance.</param>
 /// <param name="attributeReference">An attribute reference instance.</param>
 /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
 protected TargetMatchBase(string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion schemaVersion)
     : base(matchId, attributeValue, attributeReference, schemaVersion)
 {
 }