Esempio n. 1
0
        public virtual ClaimConditionStruct GetStruct()
        {
            ClaimConditionStruct propertyType = new ClaimConditionStruct();

            propertyType.property = (uint)this.ClaimProperty.PropertyType;
            if (this as EqualsClaimCondition == null)
            {
                if (this as NotEqualsClaimCondition == null)
                {
                    if (this as RegexMatchClaimCondition == null)
                    {
                        if (this as RegexNotMatchClaimCondition == null)
                        {
                            object[] str = new object[1];
                            str[0] = this.GetType().ToString();
                            throw new InvalidOperationException(SR.GetString("POLICY0039", str));
                        }
                        else
                        {
                            propertyType.comparisonOperator = 4;
                        }
                    }
                    else
                    {
                        propertyType.comparisonOperator = 3;
                    }
                }
                else
                {
                    propertyType.comparisonOperator = 2;
                }
            }
            else
            {
                propertyType.comparisonOperator = 1;
            }
            if (this.Expression as StringLiteralExpression == null)
            {
                object[] objArray = new object[1];
                objArray[0] = this.Expression.GetType().ToString();
                throw new InvalidOperationException(SR.GetString("POLICY0040", objArray));
            }
            else
            {
                propertyType.comparisonValue = ((StringLiteralExpression)this.Expression).Value;
                return(propertyType);
            }
        }
Esempio n. 2
0
		public virtual ClaimConditionStruct GetStruct()
		{
			ClaimConditionStruct propertyType = new ClaimConditionStruct();
			propertyType.property = (uint)this.ClaimProperty.PropertyType;
			if (this as EqualsClaimCondition == null)
			{
				if (this as NotEqualsClaimCondition == null)
				{
					if (this as RegexMatchClaimCondition == null)
					{
						if (this as RegexNotMatchClaimCondition == null)
						{
							object[] str = new object[1];
							str[0] = this.GetType().ToString();
							throw new InvalidOperationException(SR.GetString("POLICY0039", str));
						}
						else
						{
							propertyType.comparisonOperator = 4;
						}
					}
					else
					{
						propertyType.comparisonOperator = 3;
					}
				}
				else
				{
					propertyType.comparisonOperator = 2;
				}
			}
			else
			{
				propertyType.comparisonOperator = 1;
			}
			if (this.Expression as StringLiteralExpression == null)
			{
				object[] objArray = new object[1];
				objArray[0] = this.Expression.GetType().ToString();
				throw new InvalidOperationException(SR.GetString("POLICY0040", objArray));
			}
			else
			{
				propertyType.comparisonValue = ((StringLiteralExpression)this.Expression).Value;
				return propertyType;
			}
		}