using System; using System.Collections.Generic; using System.Linq; using System.Text; using Signum.Utilities; using Signum.Utilities.ExpressionTrees; namespace Signum.Entities.DynamicQuery { [Serializable] public class Column : IEquatable<Column> { public string DisplayName { get; set; } public QueryToken Token { get; internal set; } public Column(QueryToken token, string displayName) { Token = token; DisplayName = displayName; } public Column(ColumnDescription cd) : this(QueryToken.NewColumn(cd), cd.DisplayName) { } public string Name { get { return Token.FullKey(); } } public Type Type { get { return Token.Type; } } public Implementations Implementations { get { return Token.Implementations(); } } public string Format { get { return Token.Format; } } public string Unit { get { return Token.Unit; } } public override string ToString() { return "{0} '{1}'".Formato(Token.FullKey(), DisplayName); } public bool Equals(Column other) { return Token.Equals(other.Token) && DisplayName == other.DisplayName; } public override bool Equals(object obj) { return obj is Column && base.Equals((Column)obj); } public override int GetHashCode() { return ToString().GetHashCode(); } } //Temporaly used by the engine public class _EntityColumn : Column { public _EntityColumn(ColumnDescription entityColumn) : base(QueryToken.NewColumn(entityColumn), null) { if (!entityColumn.IsEntity) throw new ArgumentException("entityColumn"); } } public enum ColumnOptionsMode { Add, Remove, Replace, } }
By viewing downloads associated with this article you agree to the Terms of use and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)
The Next Version of Android - Some of What's Coming