示例#1
0
 TableSelectBuilder(ITableSource from, List <IWhereClause> whereClauses,
                    List <OrderByField> orderByClauses, ISelectColumns columnSelection = null,
                    IRowSelection rowSelection = null)
     : base(whereClauses, orderByClauses, columnSelection, rowSelection)
 {
     From = from;
 }
示例#2
0
 UnionSelectBuilder(ISelect innerSelect, string customAlias, ITableAliasGenerator tableAliasGenerator, List <IWhereClause> whereClauses, List <OrderByField> orderByClauses,
                    ISelectColumns columnSelection = null, IRowSelection rowSelection = null)
     : base(whereClauses, orderByClauses, columnSelection, rowSelection)
 {
     this.innerSelect         = innerSelect;
     this.customAlias         = customAlias;
     this.tableAliasGenerator = tableAliasGenerator;
 }
示例#3
0
        readonly OrderBy orderBy; // Can be null

        public Select(IRowSelection rowSelection, ISelectColumns columns, ISelectSource from, Where where, OrderBy orderBy)
        {
            this.rowSelection = rowSelection;
            this.columns      = columns;
            this.from         = from;
            this.where        = where;
            this.orderBy      = orderBy;
        }
示例#4
0
 protected SelectBuilderBase(List <IWhereClause> whereClauses, List <OrderByField> orderByClauses,
                             ISelectColumns columnSelection = null,
                             IRowSelection rowSelection     = null)
 {
     WhereClauses         = whereClauses;
     OrderByClauses       = orderByClauses;
     this.RowSelection    = rowSelection;
     this.ColumnSelection = columnSelection;
 }
示例#5
0
        public FitElement(IRowSelection rowSelection)
        {
            _independentVariables = new IReadableColumnProxy[0];

            _dependentVariables = new IReadableColumnProxy[0];

            _errorEvaluation = new IVarianceScaling[0];

            _rangeOfRows = (IRowSelection)(rowSelection?.Clone()) ?? new AllRows();
        }
示例#6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UnionOfRowSelections"/> class.
        /// </summary>
        /// <param name="rowSelectionsHead">The first row selections (cloned before stored).</param>
        /// <param name="selection">Another selection (cloned before stored).</param>
        /// <param name="rowSelectionTail">The last row selections (cloned before stored).</param>
        public UnionOfRowSelections(IEnumerable <IRowSelection> rowSelectionsHead, IRowSelection selection, IEnumerable <IRowSelection> rowSelectionTail)
        {
            _rowSelections = new List <IRowSelection>(rowSelectionsHead.Select(itemToClone => { var clonedItem = (IRowSelection)itemToClone.Clone(); clonedItem.ParentObject = this; return(clonedItem); }));

            {
                var item = (IRowSelection)selection.Clone();
                item.ParentObject = this;
                _rowSelections.Add(item);
            }

            _rowSelections.AddRange(rowSelectionTail.Select(itemToClone => { var clonedItem = (IRowSelection)itemToClone.Clone(); clonedItem.ParentObject = this; return(clonedItem); }));
        }
示例#7
0
 protected SelectBuilderBase(TSource from, List <IWhereClause> whereClauses, List <OrderByField> orderByClauses,
                             ISelectColumns columnSelection,
                             IRowSelection rowSelection,
                             bool shouldIgnoreDefaultOrderBy)
 {
     From                            = from;
     WhereClauses                    = whereClauses;
     OrderByClauses                  = orderByClauses;
     this.RowSelection               = rowSelection;
     this.ColumnSelection            = columnSelection;
     this.ShouldIgnoreDefaultOrderBy = shouldIgnoreDefaultOrderBy;
 }
示例#8
0
        public FitElement(DataTable table, int groupNumber, IRowSelection rowSelection, IReadableColumn xColumn, IReadableColumn yColumn)
        {
            if (null == rowSelection)
            {
                throw new ArgumentNullException(nameof(rowSelection));
            }

            ChildSetMember(ref _dataTable, new DataTableProxy(table));
            _groupNumber = groupNumber;
            ChildCloneToMember(ref _rangeOfRows, rowSelection);

            _independentVariables = new IReadableColumnProxy[1];
            ChildSetMember(ref _independentVariables[0], ReadableColumnProxyBase.FromColumn(xColumn));

            _dependentVariables = new IReadableColumnProxy[1];
            ChildSetMember(ref _dependentVariables[0], ReadableColumnProxyBase.FromColumn(yColumn));

            _errorEvaluation    = new IVarianceScaling[1];
            _errorEvaluation[0] = new ConstantVarianceScaling();
        }
		public IRowSelectionCollection WithAdditionalItem(IRowSelection item)
		{
			return new IntersectionOfRowSelections(_rowSelections.Concat(new[] { item }));
		}
示例#10
0
 public void AddTop(int top)
 {
     RowSelection = new Top(top);
 }
示例#11
0
 /// <summary>
 /// Returns a new instance that resembles this instance, but with the item at index <paramref name="idx"/> set to another item <paramref name="item"/>.
 /// </summary>
 /// <param name="idx">The index to change.</param>
 /// <param name="item">The new item at this index.</param>
 /// <returns>New instance that resembles this instance, but with the item at index <paramref name="idx"/> set to another item <paramref name="item"/>.</returns>
 public IRowSelectionCollection WithChangedItem(int idx, IRowSelection item)
 {
     return(new UnionOfRowSelections(_rowSelections.Take(idx), item, _rowSelections.Skip(idx + 1)));
 }
示例#12
0
 TableSelectBuilder(ITableSource from, List <IWhereClause> whereClauses,
                    List <OrderByField> orderByClauses, ISelectColumns columnSelection,
                    IRowSelection rowSelection, bool shouldIgnoreDefaultOrderBy)
     : base(from, whereClauses, orderByClauses, columnSelection, rowSelection, shouldIgnoreDefaultOrderBy)
 {
 }
示例#13
0
		public FitElement(DataTable table, int groupNumber, IRowSelection rowSelection, IReadableColumn xColumn, IReadableColumn yColumn)
		{
			if (null == table)
				throw new ArgumentNullException(nameof(table));
			if (null == rowSelection)
				throw new ArgumentNullException(nameof(rowSelection));

			ChildSetMember(ref _dataTable, new DataTableProxy(table));
			_groupNumber = groupNumber;
			ChildCloneToMember(ref _rangeOfRows, rowSelection);

			_independentVariables = new IReadableColumnProxy[1];
			_independentVariables[0] = ReadableColumnProxyBase.FromColumn(xColumn);

			_dependentVariables = new IReadableColumnProxy[1];
			_dependentVariables[0] = ReadableColumnProxyBase.FromColumn(yColumn);

			_errorEvaluation = new IVarianceScaling[1];
			_errorEvaluation[0] = new ConstantVarianceScaling();
		}
示例#14
0
		public FitElement()
		{
			_independentVariables = new IReadableColumnProxy[0];

			_dependentVariables = new IReadableColumnProxy[0];

			_errorEvaluation = new IVarianceScaling[0];

			_rangeOfRows = new AllRows();
		}
		public IRowSelectionCollection WithChangedItem(int idx, IRowSelection item)
		{
			return new IntersectionOfRowSelections(_rowSelections.Take(idx), item, _rowSelections.Skip(idx + 1));
		}
示例#16
0
 /// <summary>
 /// Returns a new instance with all row selections from this instance plus one additional item.
 /// </summary>
 /// <param name="item">The item (cloned before stored).</param>
 /// <returns>New instance with all row selections from this instance plus one additional item.</returns>
 public IRowSelectionCollection WithAdditionalItem(IRowSelection item)
 {
     return(new UnionOfRowSelections(_rowSelections.Concat(new[] { item }), _mergeAdjoiningSegments));
 }
		public IntersectionOfRowSelections(IEnumerable<IRowSelection> rowSelectionsHead, IRowSelection selection, IEnumerable<IRowSelection> rowSelectionTail)
		{
			_rowSelections = new List<IRowSelection>(rowSelectionsHead.Select(item => { var result = (IRowSelection)item.Clone(); item.ParentObject = this; return item; }));

			{
				var item = (IRowSelection)selection.Clone();
				item.ParentObject = this;
				_rowSelections.Add(item);
			}

			_rowSelections.AddRange(rowSelectionTail.Select(item => { var result = (IRowSelection)item.Clone(); item.ParentObject = this; return item; }));
		}
 /// <summary>
 /// Returns a new instance with all row selections from this instance plus one additional item.
 /// </summary>
 /// <param name="item">The item (cloned before stored).</param>
 /// <returns>New instance with all row selections from this instance plus one additional item.</returns>
 public IRowSelectionCollection WithAdditionalItem(IRowSelection item)
 {
     return(new ExcludeUnionOfRowSelections(_rowSelections.Concat(new[] { item })));
 }