/// <summary> /// This function creates a new RegKeyEntry, that represents the diff information; /// assuming that key 1 is the old information, and key 2 the new information /// /// That means: /// - if a key is missing in 1, it is to be added /// - if a key is missing in 2, it is to be removed /// - if a value is missing in 1, it is to be added /// - if a value is missing in 2, it is to be removed /// - if a value has changed, use the data from 2 /// </summary> /// <returns>A newly created RegKeyEntry that describes the differences</returns> public RegKeyEntry CreateDiffKeyEntry() { RegKeyEntry result = new RegKeyEntry(null, null); foreach (RegKeyEntry keyMissingIn1 in MissingKeysIn1) { result.AskToAddKey(keyMissingIn1); } foreach (RegKeyEntry keyMissingIn2 in MissingKeysIn2) { result.AskToRemoveKey(keyMissingIn2); } foreach (MissingValue missingValueIn1 in MissingValuesIn1) { result.AskToAddValue(missingValueIn1.Key, missingValueIn1.Value); } foreach (MissingValue missingValueIn2 in MissingValuesIn2) { result.AskToRemoveValue(missingValueIn2.Key, missingValueIn2.Value); } foreach (DataMismatch dataMismatch in DataMismatches) { result.AskToAddValue(dataMismatch.Key, dataMismatch.Value2); } foreach (KindMismatch kindMismatch in KindMismatches) { result.AskToAddValue(kindMismatch.Key, kindMismatch.Value2); } return(result); }
/// <summary> /// This function creates a new RegKeyEntry, that represents the merge information; /// assuming that key 1 is the old information, and key 2 the new information /// /// That means: /// - includes all information from key 2 /// - if a key is missing in 2, it is to be removed /// - if a value is missing in 2, it is to be removed /// - if a value has changed, use the data from 2 /// </summary> /// <returns>A newly created RegKeyEntry that describes the merge information</returns> public RegKeyEntry CreateMergeKeyEntry() { RegKeyEntry result = new RegKeyEntry(Key2); foreach (RegKeyEntry keyMissingIn2 in MissingKeysIn2) { result.AskToRemoveKey(keyMissingIn2); } foreach (MissingValue missingValueIn2 in MissingValuesIn2) { result.AskToRemoveValue(missingValueIn2.Key, missingValueIn2.Value); } return(result); }
/// <summary> /// This function creates a new RegKeyEntry, that represents the merge information; /// assuming that key 1 is the old information, and key 2 the new information /// /// That means: /// - includes all information from key 2 /// - if a key is missing in 2, it is to be removed /// - if a value is missing in 2, it is to be removed /// - if a value has changed, use the data from 2 /// </summary> /// <returns>A newly created RegKeyEntry that describes the merge information</returns> public RegKeyEntry CreateMergeKeyEntry() { RegKeyEntry result = new RegKeyEntry(Key2); foreach (RegKeyEntry keyMissingIn2 in MissingKeysIn2) { result.AskToRemoveKey(keyMissingIn2); } foreach (MissingValue missingValueIn2 in MissingValuesIn2) { result.AskToRemoveValue(missingValueIn2.Key, missingValueIn2.Value); } return result; }
/// <summary> /// This function creates a new RegKeyEntry, that represents the diff information; /// assuming that key 1 is the old information, and key 2 the new information /// /// That means: /// - if a key is missing in 1, it is to be added /// - if a key is missing in 2, it is to be removed /// - if a value is missing in 1, it is to be added /// - if a value is missing in 2, it is to be removed /// - if a value has changed, use the data from 2 /// </summary> /// <returns>A newly created RegKeyEntry that describes the differences</returns> public RegKeyEntry CreateDiffKeyEntry() { RegKeyEntry result = new RegKeyEntry(null, null); foreach (RegKeyEntry keyMissingIn1 in MissingKeysIn1) { result.AskToAddKey(keyMissingIn1); } foreach (RegKeyEntry keyMissingIn2 in MissingKeysIn2) { result.AskToRemoveKey(keyMissingIn2); } foreach (MissingValue missingValueIn1 in MissingValuesIn1) { result.AskToAddValue(missingValueIn1.Key, missingValueIn1.Value); } foreach (MissingValue missingValueIn2 in MissingValuesIn2) { result.AskToRemoveValue(missingValueIn2.Key, missingValueIn2.Value); } foreach (DataMismatch dataMismatch in DataMismatches) { result.AskToAddValue(dataMismatch.Key, dataMismatch.Value2); } foreach (KindMismatch kindMismatch in KindMismatches) { result.AskToAddValue(kindMismatch.Key, kindMismatch.Value2); } return result; }