Example #1
0
		public OutboundRuleItem(Item innerItem)
			: base(innerItem)
		{
			_BaseRuleItem = new BaseRuleItem(innerItem);
			_OutboundPreconditionItem = new OutboundPreconditionItem(innerItem);
			_OutboundMatchItem = new OutboundMatchItem(innerItem);
		}
Example #2
0
 public OutboundRuleItem(Item innerItem)
     : base(innerItem)
 {
     _BaseRuleItem             = new BaseRuleItem(innerItem);
     _OutboundPreconditionItem = new OutboundPreconditionItem(innerItem);
     _OutboundMatchItem        = new OutboundMatchItem(innerItem);
 }
Example #3
0
        private static void GetPrecondition(OutboundPreconditionItem outboundPreconditionItem, OutboundRule outboundRule)
        {
            if (outboundPreconditionItem == null || outboundPreconditionItem.Precondition == null ||
                outboundPreconditionItem.Precondition.TargetItem == null) return;

            var preconditionTargetItem = outboundPreconditionItem.Precondition.TargetItem;
            var preconditionItem = new PreconditionItem(preconditionTargetItem);

            var precondition = new Precondition
            {
                Name = preconditionItem.Name,
            };

            var conditionItems = GetBaseConditionItems(preconditionItem);
            if (conditionItems != null)
            {
                SetConditions(conditionItems, precondition);
            }

            var usingItem = preconditionItem.PreconditionUsingItem.Using.TargetItem;
            Using? usingType = null;
            if (usingItem != null)
            {
                var usingItemId = usingItem.ID.ToString();
                switch (usingItemId)
                {
                    case Constants.UsingType_RegularExpressions_ItemId:
                        usingType = Using.RegularExpressions;
                        break;
                    case Constants.UsingType_Wildcards_ItemId:
                        usingType = Using.Wildcards;
                        break;
                    case Constants.UsingType_ExactMatch_ItemId:
                        usingType = Using.ExactMatch;
                        break;
                    default:
                        break;
                }
            }
            precondition.Using = usingType;

            SetConditionLogicalGrouping(preconditionItem.ConditionLogicalGroupingItem, precondition);

            outboundRule.Precondition = precondition;
        }