Exemplo n.º 1
0
        public override bool Predicate(Services.Plugins.PluginPredicationContext context)
        {
            if (context == null || context.Node == null)
            {
                return(false);
            }

            var         target = context.Node.UnwrapValue(Tiandao.Plugins.ObtainMode.Never, null);
            ICollection collection;

            if (string.IsNullOrWhiteSpace(context.Parameter))
            {
                collection = target as ICollection;
            }
            else
            {
                collection = Tiandao.Common.Converter.GetValue(target, context.Parameter) as ICollection;
            }

            return(collection != null && collection.Count > 0);
        }
Exemplo n.º 2
0
        public override bool Predicate(Services.Plugins.PluginPredicationContext context)
        {
            if (context == null || context.Node == null)
            {
                return(false);
            }

            var         target = context.Node.UnwrapValue(Zongsoft.Plugins.ObtainMode.Never, null);
            ICollection collection;

            if (string.IsNullOrWhiteSpace(context.Parameter))
            {
                collection = target as ICollection;
            }
            else
            {
                collection = Reflection.MemberAccess.GetMemberValue <object>(target, context.Parameter) as ICollection;
            }

            return(collection != null && collection.Count > 0);
        }