protected override void ProcessLoadResults(Object results) { _features.SuspendIndexEvents(); IEnumerable <IFeatureDataRecord> features = results as IEnumerable <IFeatureDataRecord>; MergeFeatures(features); _features.RestoreIndexEvents(true); }
private void mergeFeatureTables(FeatureDataTable source, FeatureDataTable target) { Boolean isTargetEmpty = target.Rows.Count == 0; if (source.Rows.Count > 0) { Object primaryKeyIndex = null; Object srcLookupKey = createEmptyDataKey(); target.SuspendIndexEvents(); try { if (!isTargetEmpty && (target.PrimaryKeyConstraint != null)) { srcLookupKey = getSourceKeyOrTargetKeyForSource(source, target); if (getDataKeyHasValue(srcLookupKey)) { Object rowLookupKey = getDataKeyFromUniqueConstraint(target.PrimaryKeyConstraint); const DataViewRowState rowState = DataViewRowState.OriginalRows | DataViewRowState.Added; primaryKeyIndex = getDataKeySortIndex(rowLookupKey, rowState); } } foreach (FeatureDataRow sourceRow in source.Rows) { FeatureDataRow targetRow = null; if (primaryKeyIndex != null) { targetRow = target.FindMergeTarget(sourceRow, srcLookupKey, primaryKeyIndex); } //mergeFeature(target, sourceRow, targetRow, PreserveChanges); FeatureDataRow mergedRow = target.MergeRowInternal(sourceRow, targetRow, PreserveChanges, primaryKeyIndex); // If we are adding the geometry to the row or if the geometry changed // then we set it here. if (mergedRow.Geometry == null || mergedRow.Geometry.EqualsExact(sourceRow.Geometry)) { mergedRow.Geometry = sourceRow.Geometry; } mergedRow.IsFullyLoaded = mergedRow.IsFullyLoaded || sourceRow.IsFullyLoaded; } } finally { target.RestoreIndexEvents(true); } } mergeExtendedProperties(source.ExtendedProperties, target.ExtendedProperties, SchemaMergeAction, PreserveChanges); }