Beispiel #1
0
        public void Activate(ActivationContext <Token <T, TProperty> > context)
        {
            Value <TProperty> leftValue = _tokenValue.GetValue(context.Fact);

            TProperty value;

            if (leftValue.TryGetValue(out value))
            {
                if (value == null)
                {
                    return;
                }

                _elementMatch(context.Fact.Item2, (element, index) =>
                {
                    Tuple <TElement, int> item2 = Tuple.Create(element, index);

                    Token <Token <T, TProperty>, Tuple <TElement, int> > fact = Token.Create(context, item2);

                    ActivationContext <Token <Token <T, TProperty>, Tuple <TElement, int> > > propertyContext =
                        context.CreateContext(fact);

                    base.Activate(propertyContext);
                });
            }
        }
Beispiel #2
0
        public override void Activate(ActivationContext <Token <T, TProperty> > context)
        {
            var leftValue = _tokenValue.GetValue(context.Fact);

            if (_comparator.Compare(leftValue, _value))
            {
                base.Activate(context);
            }
        }
Beispiel #3
0
        public override void Activate(ActivationContext <Token <T, TProperty> > context)
        {
            Value <TProperty> leftValue = _tokenValue.GetValue(context.Fact);
            TProperty         value;

            if (leftValue.TryGetValue(out value))
            {
                base.Activate(context);
            }
        }
Beispiel #4
0
        public override void Activate(ActivationContext <Token <T, TProperty> > context)
        {
            Value <TProperty> leftValue = _tokenValue.GetValue(context.Fact);

            leftValue.Match(value =>
            {
                if (value != null)
                {
                    base.Activate(context);
                }
            });
        }
Beispiel #5
0
        public override void Activate(ActivationContext <Token <T, TProperty> > context)
        {
            Value <TProperty> leftValue = _tokenValue.GetValue(context.Fact);
            TProperty         value;

            if (leftValue.TryGetValue(out value))
            {
                if (value == null)
                {
                    return;
                }

                if (value.Cast <object>().Any())
                {
                    base.Activate(context);
                }
            }
        }
Beispiel #6
0
        public override void Activate(ActivationContext <Token <T, TProperty> > context)
        {
            Value <TProperty> leftValue = _tokenValue.GetValue(context.Fact);

            leftValue.Match(value =>
            {
                if (value != null)
                {
                    bool exists = false;
                    foreach (object item in value)
                    {
                        exists = true;
                        break;
                    }

                    if (exists)
                    {
                        base.Activate(context);
                    }
                }
            });
        }
Beispiel #7
0
        public override void Activate(ActivationContext <Token <T, TProperty> > context)
        {
            var leftValue = _tokenValue.GetValue(context.Fact);

            _comparator.Match(leftValue, _value, (x, y) => base.Activate(context));
        }