private void CreateColumnRefs() { List <ColumnRefBinding> tableColumnRefs = new List <ColumnRefBinding>(); if (!(_definition is DerivedTableBinding) && !(_definition is CommonTableBinding)) { // Create special row column ref ColumnRefBinding rowColumnRefBinding = CreateRowColumnRefBinding(this); tableColumnRefs.Add(rowColumnRefBinding); } // Create all column refs. foreach (ColumnBinding columnDefinition in _definition.Columns) { ColumnRefBinding columnRefBinding = new ColumnRefBinding(this, columnDefinition); RowBufferEntry rowBufferEntry = new RowBufferEntry(columnRefBinding.ColumnBinding.DataType); rowBufferEntry.Name = columnRefBinding.GetFullName(); ColumnValueDefinition columnValueDefinition = new ColumnValueDefinition(); columnValueDefinition.Target = rowBufferEntry; columnValueDefinition.ColumnRefBinding = columnRefBinding; columnRefBinding.ValueDefinition = columnValueDefinition; tableColumnRefs.Add(columnRefBinding); } // Assign column refs to table ref. _columnRefs = tableColumnRefs.ToArray(); }
public override void Enumerate(IMemberCompletionAcceptor acceptor) { if (acceptor == null) throw ExceptionBuilder.ArgumentNull("acceptor"); // Report all columns accessible by the table ref. TableRefBinding tableRefBinding = new TableRefBinding(null, _tableBinding, _correlationName); foreach (ColumnBinding columnBinding in _tableBinding.Columns) { ColumnRefBinding columnRefBinding = new ColumnRefBinding(tableRefBinding, columnBinding); acceptor.AcceptColumnRef(columnRefBinding); } // Now contribute any methods accessible by the row type. IMethodProvider methodProvider = _scope.DataContext.MetadataContext.MethodProviders[_tableBinding.RowType]; if (methodProvider != null) { MethodBinding[] methods = methodProvider.GetMethods(_tableBinding.RowType); foreach (MethodBinding methodBinding in methods) acceptor.AcceptMethod(methodBinding); } }
private void CreateColumnRefs() { List<ColumnRefBinding> tableColumnRefs = new List<ColumnRefBinding>(); if (!(_definition is DerivedTableBinding) && !(_definition is CommonTableBinding)) { // Create special row column ref ColumnRefBinding rowColumnRefBinding = CreateRowColumnRefBinding(this); tableColumnRefs.Add(rowColumnRefBinding); } // Create all column refs. foreach (ColumnBinding columnDefinition in _definition.Columns) { ColumnRefBinding columnRefBinding = new ColumnRefBinding(this, columnDefinition); RowBufferEntry rowBufferEntry = new RowBufferEntry(columnRefBinding.ColumnBinding.DataType); rowBufferEntry.Name = columnRefBinding.GetFullName(); ColumnValueDefinition columnValueDefinition = new ColumnValueDefinition(); columnValueDefinition.Target = rowBufferEntry; columnValueDefinition.ColumnRefBinding = columnRefBinding; columnRefBinding.ValueDefinition = columnValueDefinition; tableColumnRefs.Add(columnRefBinding); } // Assign column refs to table ref. _columnRefs = tableColumnRefs.ToArray(); }
public override IEnumerable GetRows(ColumnRefBinding[] neededColumns) { foreach (DataRow dataRow in _dataTable.Rows) { if (dataRow.RowState != DataRowState.Deleted) yield return dataRow; } }
public MetaInfo(ColumnRefBinding[] columnDependencies, TableRefBinding[] tableDependencies, bool containsSingleRowSubselects, bool containsExistenceSubselects) { _columnDependencies = columnDependencies; _tableDependencies = tableDependencies; _containsSingleRowSubselects = containsSingleRowSubselects; _containsExistenceSubselects = containsExistenceSubselects; }
private static ColumnRefBinding CreateRowColumnRefBinding(TableRefBinding tableRefBinding) { RowColumnBinding rowColumnBinding = new RowColumnBinding(tableRefBinding.TableBinding); ColumnRefBinding rowColumnRefBinding = new ColumnRefBinding(tableRefBinding, rowColumnBinding); RowBufferEntry rowColumnBufferEntry = new RowBufferEntry(rowColumnRefBinding.ColumnBinding.DataType); rowColumnBufferEntry.Name = rowColumnRefBinding.TableRefBinding.Name; ColumnValueDefinition rowColumnValueDefinition = new ColumnValueDefinition(); rowColumnValueDefinition.Target = rowColumnBufferEntry; rowColumnValueDefinition.ColumnRefBinding = rowColumnRefBinding; rowColumnRefBinding.ValueDefinition = rowColumnValueDefinition; return rowColumnRefBinding; }
public static string FormatColumnRefList(ColumnRefBinding[] columnRefBindings) { StringBuilder sb = new StringBuilder(); foreach (ColumnRefBinding columnRefBinding in columnRefBindings) { if (sb.Length > 0) sb.Append(", "); sb.Append("'"); sb.Append(columnRefBinding.GetFullName()); sb.Append("'"); } return sb.ToString(); }
private static ColumnRefBinding CreateRowColumnRefBinding(TableRefBinding tableRefBinding) { RowColumnBinding rowColumnBinding = new RowColumnBinding(tableRefBinding.TableBinding); ColumnRefBinding rowColumnRefBinding = new ColumnRefBinding(tableRefBinding, rowColumnBinding); RowBufferEntry rowColumnBufferEntry = new RowBufferEntry(rowColumnRefBinding.ColumnBinding.DataType); rowColumnBufferEntry.Name = rowColumnRefBinding.TableRefBinding.Name; ColumnValueDefinition rowColumnValueDefinition = new ColumnValueDefinition(); rowColumnValueDefinition.Target = rowColumnBufferEntry; rowColumnValueDefinition.ColumnRefBinding = rowColumnRefBinding; rowColumnRefBinding.ValueDefinition = rowColumnValueDefinition; return(rowColumnRefBinding); }
private void AddColumn(ColumnRefBinding column) { if (IsOuterScope(column.Scope) && !_columnBindingList.Contains(column)) _columnBindingList.Add(column); }
public void AcceptColumnRef(ColumnRefBinding columnRef) { Add(columnRef.Name, columnRef.GetFullName(), columnRef.ColumnBinding.DataType.Name, PROPERTY_IMG_INDEX); }
public abstract IEnumerable GetRows(ColumnRefBinding[] neededColumns);
void IErrorReporter.AmbiguousColumnRef(SourceRange sourceRange, Identifier identifier, ColumnRefBinding[] candidates) { string message = String.Format(CultureInfo.CurrentCulture, Resources.AmbiguousColumnRef, identifier, FormattingHelpers.FormatBindingList(candidates)); HandleError(sourceRange, ErrorId.AmbiguousColumnRef, message); }
void IErrorReporter.SelectExpressionNotAggregatedOrGrouped(ColumnRefBinding columnRefBinding) { string message = String.Format(CultureInfo.CurrentCulture, Resources.SelectExpressionNotAggregatedOrGrouped, columnRefBinding.GetFullName()); HandleError(ErrorId.SelectExpressionNotAggregatedOrGrouped, message); }
void IErrorReporter.OrderByExpressionNotAggregatedAndNoGroupBy(ColumnRefBinding columnRefBinding) { string message = String.Format(CultureInfo.CurrentCulture, Resources.OrderByExpressionNotAggregatedAndNoGroupBy, columnRefBinding.GetFullName()); HandleError(ErrorId.OrderByExpressionNotAggregatedAndNoGroupBy, message); }
public override IEnumerable GetRows(ColumnRefBinding[] neededColumns) { return _enumerable; }
public override IEnumerable GetRows(ColumnRefBinding[] neededColumns) { // This method is called to produce an enumerable that represents // the rows. // // NQuery will pass the values of this enumerator to method // MyColumnBinding.GetValue() to get the value of the column // in a row. return _tableData.Rows; }
public ColumnExpression(ColumnRefBinding columnRefBinding) { _columnRefBinding = columnRefBinding; }
public void AcceptColumnRef(ColumnRefBinding column) { }
public override IEnumerable GetRows(ColumnRefBinding[] neededColumns) { throw new NotImplementedException(); }
private void WriteColumnRef(ColumnRefBinding columnRefBinding) { _xmlWriter.WriteAttributeString("column", columnRefBinding.Name); WriteTableRef(columnRefBinding.TableRefBinding); }