Exemple #1
0
        public bool GetSqlCaseSensitivity([NotNull] IEnumerable <ITable> tables)
        {
            Assert.ArgumentNotNull(tables, nameof(tables));

            foreach (ITable table in tables)
            {
                int tableIndex = InvolvedTables.IndexOf(table);

                if (_tableProps[tableIndex].UseCaseSensitiveSQL)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #2
0
        public override bool ValidateParameters(out string error)
        {
            for (var i = 1; i < _fromClassCount; i++)
            {
                // IndexOf returns always the first Occurrence of an item
                if (InvolvedTables.IndexOf(InvolvedTables[i]) == i)
                {
                    continue;
                }

                error = string.Format("{0} exists multiple times as from featureClass",
                                      DatasetUtils.GetName(InvolvedTables[i]));
                return(false);
            }

            error = null;
            return(true);
        }
        protected override int FindErrors(IRow row1, int tableIndex1, IRow row2,
                                          int tableIndex2)
        {
            int errorCount = 0;

            int  iTbl0 = InvolvedTables.IndexOf(row1.Table);
            int  iTbl1 = InvolvedTables.IndexOf(row2.Table);
            bool valid = false;

            foreach (QueryFilterHelper[] rule in _rules)
            {
                if (rule[iTbl0] == null || rule[iTbl1] == null)
                {
                    continue;
                }

                if (rule[iTbl0].MatchesConstraint(row1) && rule[iTbl1].MatchesConstraint(row2))
                {
                    valid = true;
                    break;
                }
            }

            if (!valid)
            {
                var geom1 = (ITopologicalOperator2)((IFeature)row1).ShapeCopy;
                var geom2 = (ITopologicalOperator2)((IFeature)row2).ShapeCopy;

                //ESRI Bug (9.2 Service Pack 1) : Spatial references must be set as equal, even when equal FeatureClasses
                ((IGeometry)geom2).SpatialReference = ((IGeometry)geom1).SpatialReference;
                IGeometry intersect = geom1.Intersect((IGeometry)geom2,
                                                      esriGeometryDimension.esriGeometry0Dimension);

                const string description = "Rows do not fulfill rules";
                ReportError(description,
                            ((IPointCollection)intersect).get_Point(0), row1, row2);
                errorCount++;
            }

            return(errorCount);
        }
Exemple #4
0
        public bool GetSqlCaseSensitivity([NotNull] ITable table)
        {
            int tableIndex = InvolvedTables.IndexOf(table);

            return(_tableProps[tableIndex].UseCaseSensitiveSQL);
        }
Exemple #5
0
        protected string GetConstraint([NotNull] ITable table)
        {
            int tableIndex = InvolvedTables.IndexOf(table);

            return(_tableProps[tableIndex].Constraint);
        }