/// <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 the ResourceMatch 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 ResourceMatchElement( string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion version ) : 
			base( matchId, attributeValue, attributeReference, version )
		{
		}
		/// <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( MatchElement.MatchId );
				while( reader.Read() )
				{
					if( reader.LocalName == PolicySchema1.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 == PolicySchema1.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( Resource.ResourceManager[ Resource.MessageKey.exc_invalid_node_name, reader.LocalName ] );
			}
		}
Example #4
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 )
		{
		}
		/// <summary>
		/// Creates an instance of the EnvironmentMatch 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 EnvironmentMatchElementReadWrite( string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion version ) : 
			base( matchId, attributeValue, attributeReference, version )
		{
		}