Exemplo n.º 1
0
		public virtual bool Compare(Rule other)
		{
			if (other != null)
			{
				if (this.Output == other.Output)
				{
					if (this.IssuanceStatement.Compare(other.IssuanceStatement))
					{
						return true;
					}
					else
					{
						return false;
					}
				}
				else
				{
					return false;
				}
			}
			else
			{
				return false;
			}
		}
Exemplo n.º 2
0
		public virtual void Validate(Rule context)
		{
			Utility.VerifyNonNull("ClaimProperty", this.ClaimProperty);
			Utility.VerifyNonNull("Expression", this.Expression);
			this.ClaimProperty.Validate();
			this.Expression.Validate(context);
		}
Exemplo n.º 3
0
		public override bool Compare(Rule other)
		{
			SelectionRule selectionRule = other as SelectionRule;
			if (selectionRule != null)
			{
				if (this.Conditions.Count == selectionRule.Conditions.Count)
				{
					int num = 0;
					while (num < this.Conditions.Count)
					{
						if (this.Conditions[num].Compare(selectionRule.Conditions[num]))
						{
							num++;
						}
						else
						{
							return false;
						}
					}
					return base.Compare(other);
				}
				else
				{
					return false;
				}
			}
			else
			{
				return false;
			}
		}
Exemplo n.º 4
0
		public override void Validate(Rule context)
		{
			Utility.VerifyNonNullArgument("context", context);
			Utility.VerifyNonNull("ConditionTag", this.ConditionTag);
			SelectionRule selectionRule = context as SelectionRule;
			if (selectionRule != null)
			{
				IEnumerator<SelectionCondition> enumerator = selectionRule.Conditions.GetEnumerator();
				using (enumerator)
				{
					while (enumerator.MoveNext())
					{
						SelectionCondition current = enumerator.Current;
						if (StringComparer.OrdinalIgnoreCase.Compare(this.ConditionTag, current.ConditionTag) != 0)
						{
							continue;
						}
						return;
					}
					object[] conditionTag = new object[1];
					conditionTag[0] = this.ConditionTag;
					throw new PolicyValidationException(SR.GetString("POLICY0011", conditionTag));
				}
				return;
			}
			else
			{
				object[] str = new object[1];
				str[0] = context.GetType().ToString();
				throw new PolicyValidationException(SR.GetString("POLICY0001", str));
			}
		}
Exemplo n.º 5
0
		public override bool Compare(Rule other)
		{
			UnconditionalRule unconditionalRule = other as UnconditionalRule;
			if (unconditionalRule != null)
			{
				return base.Compare(other);
			}
			else
			{
				return false;
			}
		}
Exemplo n.º 6
0
		public override void Validate(Rule context)
		{
			Utility.VerifyNonNullArgument("context", context);
			new Dictionary<string, object>(StringComparer.Ordinal);
			Dictionary<string, object> strs = new Dictionary<string, object>(StringComparer.Ordinal);
			foreach (ClaimPropertyAssignment claimPropertyAssignment in this.ClaimPropertyAssignments)
			{
				claimPropertyAssignment.Validate(context);
				//claimPropertyAssignment.ClaimProperty.PropertyType;
				string str = claimPropertyAssignment.ClaimProperty.PropertyType.ToString();
				if (!strs.ContainsKey(str))
				{
					strs.Add(str, null);
				}
				else
				{
					object[] objArray = new object[1];
					objArray[0] = str;
					throw new PolicyValidationException(SR.GetString("POLICY0009", objArray));
				}
			}
			if (strs.ContainsKey(ClaimPropertyType.Type.ToString()))
			{
				if (strs.ContainsKey(ClaimPropertyType.Value.ToString()))
				{
					return;
				}
				else
				{
					throw new PolicyValidationException(SR.GetString("POLICY0008", new object[0]));
				}
			}
			else
			{
				throw new PolicyValidationException(SR.GetString("POLICY0007", new object[0]));
			}
		}
Exemplo n.º 7
0
		public abstract void Validate(Rule context);