/// <summary> /// Returns a list with all fields that have different values for two given work items. /// </summary> /// <param name="wordFields">Fields of a Word work item.</param> /// <param name="tfsFields">Fields of a TFS work item.</param> /// <param name="ignoreFormatting">Sets whether formatting is ignored.</param> /// <returns>List of different fields.</returns> public static Collection <IField> GetFieldsWithDifferentValues2(IFieldCollection wordFields, IFieldCollection tfsFields, bool ignoreFormatting) { Guard.ThrowOnArgumentNull(wordFields, "wordFields"); Guard.ThrowOnArgumentNull(tfsFields, "tfsFields"); var changedFields = new Collection <IField>(); foreach (var field in wordFields) { try { if (tfsFields.Contains(field.ReferenceName)) { if (!tfsFields[field.ReferenceName].CompareValue(wordFields[field.ReferenceName].Value, ignoreFormatting)) { changedFields.Add(field); } } } catch (KeyNotFoundException) { SyncServiceTrace.W("Converter value not found. Please check your configuration"); } } return(changedFields); }