I'm in the process of upgrading my C# application from FIT SDK 1.x to 20.50.00.
The application allows Fields to be removed from Mesgs in order, for example, to remove GPS data from a FIT activity file.
The code written against the 1.x SDK did this by identifying a field to be removed from a Mesg and calling:
mesg.fields.Remove(field);
This won't work with SDK 20.50.00 as the fields collection is now private. I also can't use the public Fields property as this is implemented as IEnumerable<Field> and does not have a Remove() method.
Ideally, in the same way that the Mesg class implements an InsertField() method there should be a RemoveField() method.
I have added this to my local copy of the Dynastream source code as a temporary fix:
/// <summary>
/// Remove the specified field.
/// </summary>
/// <param name="field">The Field instance to be removed.</param>
public void RemoveField(Field field)
{
this.FieldsList.Remove(field);
}