예제 #1
0
        public static HtmlComposite GenerateHtmlTreeNode <T>(EixoX.Collections.TreeNode <T> treeNode, string identityPrefix, ClassAcessor identityMember)
        {
            HtmlComposite li = new HtmlComposite("li");

            if (identityMember != null)
            {
                li.Attributes.AddLast("id", identityPrefix + identityMember.GetValue(treeNode.Value));
            }

            li.Children.AddLast(new HtmlSimple("span", treeNode.Value));

            if (treeNode.Count > 0)
            {
                li.Children.AddLast(GenerateHtmlTree <T>(treeNode, identityPrefix, identityMember));
            }

            return(li);
        }
        public bool FilterPass(object entity, object value)
        {
            object input = _Acessor.GetValue(entity);

            switch (this._Comparison)
            {
            case ClassFilterComparison.EqualTo:
                return(value == null ? input == null : value.Equals(input));

            case ClassFilterComparison.GreaterOrEqual:
                return(((IComparable)input).CompareTo(value) >= 0);

            case ClassFilterComparison.GreaterThan:
                return(((IComparable)input).CompareTo(value) > 0);

            case ClassFilterComparison.In:
                return(In((IEnumerable)value, input));

            case ClassFilterComparison.Like:
                return(Like(input, value));

            case ClassFilterComparison.LowerOrEqual:
                return(((IComparable)input).CompareTo(value) <= 0);

            case ClassFilterComparison.LowerThan:
                return(((IComparable)input).CompareTo(value) < 0);

            case ClassFilterComparison.Not_EqualTo:
                return(value == null ? input != null : !value.Equals(input));

            case ClassFilterComparison.Not_In:
                return(!In((IEnumerable)value, input));

            case ClassFilterComparison.Not_Like:
                return(!Like(input, value));

            default:
                throw new NotImplementedException(_Comparison.ToString());
            }
        }
예제 #3
0
 /// <summary>
 /// Gets a value from an entity.
 /// </summary>
 /// <param name="entity">The entity to read the value from.</param>
 /// <returns>The value read.</returns>
 public virtual object GetValue(object entity)
 {
     return(_Acessor.GetValue(entity));
 }