コード例 #1
0
        protected override Boolean ExecuteFunction(IExpressionContext ctx, IExpression[] arguments)
        {
            var value = arguments[0];

            var nullObj = value as Null;

            if (nullObj != null)
            {
                return(Boolean.True);
            }

            var array = value as Array;

            if (array != null)
            {
                return(new Boolean(array.Length == 0));
            }

            var text = value as Types.Text;

            if (text != null)
            {
                return(new Boolean(text.Length == 0));
            }

            return(new Boolean(value.ToString().Trim().Length == 0));
        }
コード例 #2
0
        protected override Integer ExecuteFunction(IExpressionContext ctx, IExpression[] arguments)
        {
            var obj = arguments[0];

            var array = obj as Array;

            if (array != null)
            {
                return(new Integer(array.Length));
            }

            var text = obj as Types.Text;

            if (text != null)
            {
                return(new Integer(text.Length));
            }

            return(new Integer(0));
        }