/// <summary> /// Bounds a Model property to a field. /// </summary> /// <param name="action">The action.</param> /// <returns>Instance of <see cref="FlexiGridColumnSettings"/></returns> public FlexiGridColumnSettings Bound(Expression <Func <T, object> > action) { var expression = RemoveUnary(action.Body) as MemberExpression; if (expression == null) { throw new ArgumentException("Invalid column binding"); } var column = new FlexiGridColumn <T>(expression.Member.Name); this._columns.Add(column); return(column.ColumnSettings); }
/// <summary> /// Adds an item to the <see cref="T:System.Collections.Generic.ICollection`1"/>. /// </summary> /// <param name="item">The object to add to the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param> /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.</exception> public void Add(FlexiGridColumn <T> item) { this._columns.Add(item); }
/// <summary> /// Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.ICollection`1"/>. /// </summary> /// <returns>true if <paramref name="item"/> /// was successfully removed from the <see cref="T:System.Collections.Generic.ICollection`1"/>; otherwise, false. This method also returns false if <paramref name="item"/> /// is not found in the original <see cref="T:System.Collections.Generic.ICollection`1"/>.</returns> /// <param name="item">The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param> /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.</exception> public bool Remove(FlexiGridColumn <T> item) { return(this._columns.Remove(item)); }
/// <summary> /// Determines whether the <see cref="T:System.Collections.Generic.ICollection`1"/> contains a specific value. /// </summary> /// <returns>true if <paramref name="item"/> is found in the <see cref="T:System.Collections.Generic.ICollection`1"/>; otherwise, false.</returns> /// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param> public bool Contains(FlexiGridColumn <T> item) { return(this._columns.Contains(item)); }