public IFIDSet FindHistoricalDifferences(IWorkspace workspace, string historicalMarkerName, string tableName, esriDifferenceType differenceType) { IHistoricalWorkspace historicalWorkspace = (IHistoricalWorkspace)workspace; IHistoricalVersion historicalVersion = historicalWorkspace.FindHistoricalVersionByName(historicalWorkspace.DefaultMarkerName); IHistoricalVersion historicalVersion1 = historicalWorkspace.FindHistoricalVersionByName(historicalMarkerName); IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)historicalVersion; IFeatureWorkspace featureWorkspace1 = (IFeatureWorkspace)historicalVersion1; ITable table = featureWorkspace.OpenTable(tableName); ITable table1 = featureWorkspace1.OpenTable(tableName); IDifferenceCursor differenceCursor = ((IVersionedTable)table).Differences(table1, differenceType, null); IFIDSet fIDSetClass = new FIDSet(); IRow row = null; int num = -1; differenceCursor.Next(out num, out row); while (num != -1) { fIDSetClass.Add(num); differenceCursor.Next(out num, out row); } fIDSetClass.Reset(); return(fIDSetClass); }
public static IFIDSet FindVersionDifferences(IWorkspace workspace, string childVersionName, string parentVersionName, string tableName, esriDifferenceType differenceType) { IVersionedWorkspace versionedWorkspace = (IVersionedWorkspace)workspace; IVersion version = versionedWorkspace.FindVersion(childVersionName); IVersion version1 = versionedWorkspace.FindVersion(parentVersionName); IVersion commonAncestor = ((IVersion2)version).GetCommonAncestor(version1); ITable table = ((IFeatureWorkspace)version).OpenTable(tableName); ITable table1 = ((IFeatureWorkspace)commonAncestor).OpenTable(tableName); IDifferenceCursor differenceCursor = ((IVersionedTable)table).Differences(table1, differenceType, null); IFIDSet fIDSetClass = new FIDSet(); IRow row = null; int num = -1; differenceCursor.Next(out num, out row); while (num != -1) { fIDSetClass.Add(num); differenceCursor.Next(out num, out row); } fIDSetClass.Reset(); return(fIDSetClass); }