public override bool Compare(Expression other)
        {
            ClaimPropertyAccessExpression claimPropertyAccessExpression = other as ClaimPropertyAccessExpression;

            if (claimPropertyAccessExpression != null)
            {
                if (StringComparer.OrdinalIgnoreCase.Equals(this.ConditionTag, claimPropertyAccessExpression.ConditionTag))
                {
                    if (this.ClaimProperty.Compare(claimPropertyAccessExpression.ClaimProperty))
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
		private void HandleExpr__IDENTIFIER_DOT_ClaimProp()
		{
			if (this._policyObjects.Count != 0)
			{
				DebugLog.PolicyEngineTraceLog.Assert(this.valueStack.Top - 3 >= 0, "there should be more than 2 values in stack", new object[0]);
				string stringValue = this.valueStack.Elements[this.valueStack.Top - 3].StringValue;
				if (!string.IsNullOrEmpty(stringValue))
				{
					ClaimProperty claimProperty = this._policyObjects.Peek() as ClaimProperty;
					if (claimProperty != null)
					{
						this._policyObjects.Pop();
						ClaimPropertyAccessExpression claimPropertyAccessExpression = new ClaimPropertyAccessExpression(claimProperty, stringValue);
						this._policyObjects.Push(claimPropertyAccessExpression);
						return;
					}
					else
					{
						object[] objArray = new object[1];
						objArray[0] = "ClaimProperty";
						throw new InvalidOperationException(SR.GetString("POLICY0037", objArray));
					}
				}
				else
				{
					object[] objArray1 = new object[1];
					objArray1[0] = "Identifier";
					throw new InvalidOperationException(SR.GetString("POLICY0037", objArray1));
				}
			}
			else
			{
				throw new InvalidOperationException(SR.GetString("POLICY0038", new object[0]));
			}
		}