Ejemplo n.º 1
0
        public GridColumn(Expression <Func <T, TDataType> > expression, CGrid <T> grid)
        {
            #region Setup defaults

            EncodeEnabled   = true;
            SortEnabled     = false;
            SanitizeEnabled = true;

            Hidden = false;

            _filterWidgetTypeName = PropertiesHelper.GetUnderlyingType(typeof(TDataType)).FullName;
            _grid = grid;

            #endregion

            if (expression != null)
            {
                var expr = expression.Body as MemberExpression;
                if (expr == null)
                {
                    throw new ArgumentException(
                              string.Format("Expression '{0}' must be a member expression", expression),
                              "expression");
                }

                _constraint = expression.Compile();
                _orderers.Insert(0, new OrderByGridOrderer <T, TDataType>(expression));
                _filter = new DefaultColumnFilter <T, TDataType>(expression);
                _search = new DefaultColumnSearch <T, TDataType>(expression);
                _group  = new DefaultColumnGroup <T, TDataType>(expression);
                //Generate unique column name:
                Name  = PropertiesHelper.BuildColumnNameFromMemberExpression(expr);
                Title = Name; //Using the same name by default
            }
        }
Ejemplo n.º 2
0
 private void VerifyRowCount(IColumnGroup columnGroup)
 {
     if (RowCount != columnGroup.RowCount)
     {
         throw new ArgumentException(string.Format(@"Expected row count:{0} actual:{1}", RowCount, columnGroup.RowCount));
     }
 }
Ejemplo n.º 3
0
 public IList <object> GetGroupValues(IColumnGroup <T> group, IEnumerable <object> items)
 {
     if (group == null)
     {
         return(new List <object>());
     }
     return(group.GetColumnValues((items as IEnumerable <T>).AsQueryable()).ToList());
 }
Ejemplo n.º 4
0
 public DataFrame SetRowHeaders(IColumnGroup rowHeaders)
 {
     if (null == rowHeaders)
     {
         return((DataFrame)RemoveRowHeader());
     }
     VerifyRowCount(rowHeaders);
     return(new DataFrame(Title, RowCount)
     {
         RowHeader = rowHeaders,
         ColumnGroups = ColumnGroups
     });
 }
Ejemplo n.º 5
0
 public DataFrame SetRowHeaders(IColumnGroup rowHeaders)
 {
     if (null == rowHeaders)
     {
         return (DataFrame) RemoveRowHeader();
     }
     VerifyRowCount(rowHeaders);
     return new DataFrame(Title, RowCount)
                {
                    RowHeader = rowHeaders, 
                    ColumnGroups = ColumnGroups
                };
 }
Ejemplo n.º 6
0
 public DataFrameBuilder AddColumn(IColumnGroup column)
 {
     return SetDataFrame(DataFrame.AddColumn(column));
 }
Ejemplo n.º 7
0
 public IList <object> GetGroupValues(IColumnGroup <T> group, IEnumerable <object> items)
 {
     return(_source.GetGroupValues(group, items));
 }
Ejemplo n.º 8
0
 public DataFrame AddColumn(IColumnGroup column)
 {
     return AddColumns(new[] {column});
 }
Ejemplo n.º 9
0
 public DataFrame(string title, IColumnGroup rowHeaders)
     : this(title, rowHeaders.RowCount)
 {
     RowHeader = rowHeaders;
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Constructs a DataFrame with zero columns and the specified number of rows.
 /// </summary>
 public DataFrame(string title, int rowCount)
 {
     Title = title;
     RowCount = rowCount;
     ColumnGroups = new IColumnGroup[0];
 }
Ejemplo n.º 11
0
 private void VerifyRowCount(IColumnGroup columnGroup)
 {
     if (RowCount != columnGroup.RowCount)
     {
         throw new ArgumentException(string.Format("Expected row count:{0} actual:{1}", RowCount, columnGroup.RowCount)); // Not L10N
     }
 }
Ejemplo n.º 12
0
 public DataFrame AddColumn(IColumnGroup column)
 {
     return(AddColumns(new[] { column }));
 }
Ejemplo n.º 13
0
 public DataFrame(string title, IColumnGroup rowHeaders) : this(title, rowHeaders.RowCount)
 {
     RowHeader = rowHeaders;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Constructs a DataFrame with zero columns and the specified number of rows.
 /// </summary>
 public DataFrame(string title, int rowCount)
 {
     Title        = title;
     RowCount     = rowCount;
     ColumnGroups = new IColumnGroup[0];
 }
Ejemplo n.º 15
0
 public DataFrameBuilder AddColumn(IColumnGroup column)
 {
     return(SetDataFrame(DataFrame.AddColumn(column)));
 }