Esempio n. 1
0
        /// <summary>
        /// Checks if the specified row fulfils the test constraints
        /// </summary>
        /// <returns></returns>
        internal bool CheckConstraint(IRow row, int tableIndex)
        {
            if (row.Table == null)
            {
                // Mock Row (TerrainRow or RasterRow
                Assert.True(row is IMockRow, "table is null for regular row");

                return(true);
            }

            if (row.Table != InvolvedTables[tableIndex])
            {
                throw new InvalidProgramException("row does not correspond to table index");
            }

            QueryFilterHelper filterHelper = _filterHelpers[tableIndex];

            return(filterHelper == null || filterHelper.MatchesConstraint(row));
        }
Esempio n. 2
0
        protected void CopyFilters([NotNull] out IList <ISpatialFilter> spatialFilters,
                                   [NotNull] out IList <QueryFilterHelper> filterHelpers)
        {
            int tableCount = InvolvedTables.Count;

            spatialFilters = new ISpatialFilter[tableCount];
            filterHelpers  = new QueryFilterHelper[tableCount];

            for (var tableIndex = 0; tableIndex < tableCount; tableIndex++)
            {
                ITable table = InvolvedTables[tableIndex];

                filterHelpers[tableIndex] = new QueryFilterHelper(table,
                                                                  GetConstraint(tableIndex),
                                                                  GetSqlCaseSensitivity(
                                                                      tableIndex));
                spatialFilters[tableIndex] = new SpatialFilterClass();

                ConfigureQueryFilter(tableIndex, spatialFilters[tableIndex]);
            }
        }
Esempio n. 3
0
 protected override void SetConstraintCore([NotNull] ITable table, int tableIndex,
                                           [CanBeNull] string constraint)
 {
     _filterHelpers[tableIndex] = new QueryFilterHelper(table, constraint,
                                                        GetSqlCaseSensitivity(tableIndex));
 }